Chi Minh Trinh
Chi Minh Trinh

Reputation: 11

"Error: Unsupported configuration: sampleRate 44100, format 1, channelCount 1"-AudioRecord Android

I don't understand why I have this error. Can you help me?

Here is my code:

int bufferSize = AudioRecord.getMinBufferSize(44100,AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);

AudioRecord audioRecord = new AudioRecord( MediaRecorder.AudioSource.MIC, 44100,AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);

Error:

Error: Unsupported configuration: sampleRate 44100, format 1, channelCount 1"-AudioRecord Android

Upvotes: 0

Views: 2657

Answers (2)

wonderyl
wonderyl

Reputation: 21

it seems emulator only support sample rate = 8000, changed the sample rate and it works just fine.

Upvotes: 2

Femi
Femi

Reputation: 64700

Very odd, but the error is self-explanatory: the device you're running on doesn't have audio hardware/mixer support for a 16-bit mono audio channel at a 44.1 kHz sample rate. Is this a hardware device or an emulator?

Upvotes: 2

Related Questions