Android - Recorded audio file differs size when changing device

限于喜欢 提交于 2019-12-25 02:28:20

问题


I am trying to record an audio file in Android, I'm setting the output file bit rate and sampling rate, everything is working right but whenever i record anything in a different device the file size differs a lot.

I have made some tests with a Z2 and a Moto G changing bit rate and sampling rate, obtaining very different file sizes on same recording time. I have noticed that the file depends the most on bit rate rather than sampling rate.

The problem is that i would expect and actually need files to be as little as possible but, even when with Moto G i get files from 38 - 254KB, files on same configuration on Z2 are 437 - 653KB size.

I don't know what to do to get files on Z2 (and any other device) with almost same size as Moto G, any help would be greatly appreciated.

Sorry for my english, It is not my natural language.

P.D: Using MediaInfo, I get that only difference in files is "Overall bit rate". When setting bit rate to 16000, Moto G file on MediaInfo shows 19.4Kbps and Z2 file shows 226Kbps but both shows "Bit rate" = 16.8Kbps.


回答1:


The reason for different sizes on different devices could be explained by two factors, audio resolution (microphone quality) and bitrate type, if you have a really good microphone to capture high audio frequencies you will have a more complex audio to compress, but if you have a low quality microphone able to record audio using only mid range frequencies your audio will lack detail and be simpler to compress. The other fact is the bitrate, VBR vs CBR, if you use Variable Bit Rate and the audio to encode doesn't have a lot of detail, it will lower the bitrate, but if suddenly you have the sound of cymbals for example, the details in the audio is higher and it requires a higher bitrate to encode, in the other hand, if you encode the audio using Constant Bit Rate your output will be always the same... let's say that you record 1min of audio using 128Kbps (almost certain that you don't need more than that) you will have 60s * 128Kbps = 7680Kbs... 7680Kbs / 8B = 960KB per minute.



来源:https://stackoverflow.com/questions/24988459/android-recorded-audio-file-differs-size-when-changing-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!