下面是将.amr文件放入字节数组的代码片段。
我知道如何从标题中获得比特率,如下所示。因此,假设比特率为7.95,计算帧大小的公式是什么?谢谢。
public void getFrames() {
File inputFile = new File(getmFileName());
try {
FileInputStream fis = new FileInputStream(inputFile);
byte fileContent[]= new byte[(int) inputFile.length()];
fis.read(fileContent); // Reads the file content as byte.
fis.close();
int count = 0;
for (int i = 0; i < 8; i++) {
Log.i(LOG_TAG, "byte"+ fileContent[i]);
count++;
Log.i(LOG_TAG, "7thbyte_of_1stHeader:" + ((fileContent[7]>>3)& 0x0F) );
}} catch (Exception ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
} }发布于 2014-03-27 06:41:26
诺基亚提供下表用于编解码模式(CMR)、比特率和帧大小之间的关系:
CMR MODE FRAME SIZE( in bytes )
0 AMR 4.75 13
1 AMR 5.15 14
2 AMR 5.9 16
3 AMR 6.7 18
4 AMR 7.4 20
5 AMR 7.95 21
6 AMR 10.2 27
7 AMR 12.2 32https://stackoverflow.com/questions/22676906
复制相似问题