On an Android 2.1 device (Samsung Galexy S), I am trying to record audio data using the following code.
int frequency = 16000;
int channelConfiguration = AudioFormat.CHANNEL_IN_MONO;
int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;
int bufferSize = AudioRecord.getMinBufferSize(frequency, channelConfiguration, audioEncoding);
AudioRecord audioRecord = new AudioRecord( MediaRecorder.AudioSource.MIC,
frequency, channelConfiguration, audioEncoding, bufferSize);
short [] buffer = new short[bufferSize];
isAdIdle = false; audioRecord.startRecording();
while( isRecording ) { int bufferReadResult = audioRecord.read(buffer, 0, bufferSize); // save buffer data
}
This code worked well on other devices, such as nexus one, but on the Samsung Galexy S, I have the following error message:
AFCCreateReSampler: avAFCInfo->bUsed[0] in SampleRate[44100] outSampleRate[16000] nChannel[2] outBitDepth[16]
What is the problem? Could anyone help me to resolve this one?
Thanks in advance~ YI Kim.