Monday 19 December 2011

Audio Record Support for Android Emulator

To test your applications which use android AudioRecord calss, you should set this class's constructor with supported device properties. In the android documentation, it says Android devices support at least;
Sample rate: 44100Mhz
Channel Type: CHANNEL_IN_MONO
Encoding: ENCODING_PCM_16BIT

But unfortunately this is not correct. Because neither emulator nor my Samsung Galaxy S2 supports this configuration. I have just discovered that the correct initialization for the android emulator is


Sample rate: 8000Mhz
Channel Type: CHANNEL_IN_MONO
Encoding: ENCODING_PCM_16BIT

 this works for minimum buffer size calculation with getMinBufferSize(,,)

Cheers!