My application measures the volume of captured sound depending on the absolute amplitude of the sample.
I noticed unexpected behavior in the android.media.AudioRecord Android SDK. Let the following flow be assumed:
- Application starts
- Sound volume is measured
- Answer a phone call / dialed phone
- Sound volume is measured
The noise around the microphone is made by a television with constant volume control. The values โโmeasured for point 2 are in the range [55โ65], and the values โโmeasured for point 4 are in the range [15โ25] (see Sound visualization for 2. and 4. below).
I understand that when you make a phone call, there is some volume control. Can these adjustments be controlled or eliminated?
I tried AutomaticGainControl, but it is not supported on my Nexus 5, and I do not want to use it, since the target devices may also not support it.
Update This volume control does not only happen after a telephone conversation. I just noticed the same behavior when the phone just lay on the table, measuring the volume.

source share