AMR
我的Android 应用程序以两种WAV
格式录制音频。我的应用程序需要将第二个录制的音频文件插入到第一个文件中的暂停位置。我用WAV
文件做对了,但是AMR
插入后的文件无法在 Android MediaPlayer 中播放,当它到达插入位置时会出现一些错误。但相同的文件在 AMR 播放器中播放正常。
我遵循的步骤是:
1.从file1写入数据到暂停位置:
raf3=new RandomAccessFile(result,"rw");
raf3.setLength(0);
int d=0;
//Write data from record1 upto the pause position
while(d!=pos)
{
raf3.write(bytes[d]);
d++;
}
2.从file2写入要插入的数据
//write all the data from record 2
int l=0;
raf3.writeBytes(" ");
while(l!=bytesread1)
{
raf3.write(bytes1[l]);
l++;
}
3.暂停位置后从file1写入剩余数据
while(d!=size){
raf3.write(bytes[d]);
d++;
}
我所做的有什么问题吗?