My application is measuring volume of captured audio as a function of samples absolute amplitude.
I've noticed and unexpected behavior in android.media.AudioRecord
of Android SDK. Let's assume following flow:
- Application is launched
- Audio volume is being measured
- Phone call is answered/dialed
- Audio volume is being measured
The noise around the microphone is produced by TV with constant volume setting. Values measured for point 2 are in range [55-65] and values measured for point 4 are in range [15-25] (please see the audio visualization for 2. and 4. below).
I understand that there must be some volume adjustment going on when phone call occurs. Is it possible to monitor those adjustments or to get rid of them?
I've tried AutomaticGainControl but it is not supported on my Nexus 5 and I do not want to use it since the target devices might not support it as well.
Update This volume adjustment is happening not only after phone call. I've just noticed the same behavior when phone was just lying on the table measuring volume.