What audio encodings are supported on Android Emulator?
I am trying a small program on the emulator
int frequency=8000;
int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audi开发者_开发问答oEncoding = AudioFormat.ENCODING_PCM_8BIT;
bufferSize = AudioRecord.getMinBufferSize(frequency,
channelConfiguration, audioEncoding);
I keep getting bufferSize -2.
hwaudioInput:yes is set for the emulator.
For what values should this work? Or do you have any other ideas why this is not working? Is there way to check why getMinBufferSize fails? What is the exact error message?
Thank you.
Try audioEncoding = AudioFormat.ENCODING_PCM_16BIT;
int frequency=8000;
int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;
bufferSize = AudioRecord.getMinBufferSize(frequency,
channelConfiguration, audioEncoding);
精彩评论