AudioSource.VOICE_COMMUNICATION doesn't work on all devices which are support VOICE_COMMUNICATION

2.4k views Asked by At

I use AudioSource.VOICE_COMMUNICATION as source in my AudioRecord instance for all devices which support this. This works good on all my tablets except one. The "Acer Iconia Tab 8".

AcousticEchoCanceler, AutomaticGainControl, NoiseSuppressor are available. The Android Version is 4.4.2

The receiving device only get audio data with a buzzing. If i use AudioSource.MIC which is used on the fallback for devices which are not support AudioSource.VOICE_COMMUNICATION it works, but without the EchoCancelation which are needed and which should supported by this device.

final int bufSize = Math.max(1 * 2 * 8000, AudioRecord.getMinBufferSize(8000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT));
AudioRecord rec;
try {
    final int src = MediaRecorder.AudioSource.VOICE_COMMUNICATION;
    rec = new AudioRecord(src, 8000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, bufSize);
} catch (IllegalArgumentException e) {
    Log.d("AudioRecorder", "echo cancellation NOT enabled (old android version)");
    final int src = MediaRecorder.AudioSource.MIC;
    rec = new AudioRecord(src, 8000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, bufSize);
}

Anybody an idea about this strange behavior?

1

There are 1 answers

0
NerdNeo On BEST ANSWER

I got the same problem and solved it with an update of Android.