2

I have made a program that reads a fixed number of bytes from the microphone and sends it out to the speaker, effectively a program to route audio from the mic to speaker without any changes

Normally I can hear what I say into the microphone loud and clear on the attached headphone

However, if I blow into the microphone, I can momentarily notice the sound in the earphone going smaller, which slowly rises back to its normal volume

I think some kind of built in noise reduction or some other effect is kicking in when I blow into the microphone

Is there any way to completely stop or bypass any kind of preprocessing the phone does to the microphone input samples, or to the output samples?I have looked at all the sound related settings on the phone and they are all disabled, at least as far as I can tell. I use AudioRecord class to get microphone audio samples and AudioTrack to play them back. AudioRecord source is MediaRecorder.AudioSource.DEFAULT (MediaRecorder.AudioSource.MIC gives the same result). MediaRecorder.AudioSource.VOICE_RECOGNITION doesn't seem to have any effects on the input sound, but I would have guessed that MediaRecorder.AudioSource.DEFAULT or .MIC would be the option without any preprocessing attached to it.

I would like to know if there is a way to completely prevent the phone from doing any kind of audio processing, at the mic or the speaker side, through some option in the phone settings or through adb or in my program's code.

The phone is Samsung Galaxy S7 with android 8.0, but I am looking for a a general solution if it exists.

3
  • i truly hate this "feature" i bet it is part of audio codecs and can't disabled. welcome to the new world
    – alecxs
    Jul 2, 2020 at 6:32
  • I see reference to android.media.audiofx.NoiseSuppressor in source.android.com/compatibility/8.0/… Not sure if you tried it and found it lacking. Jul 2, 2020 at 6:55
  • If you blow into the microphone I would assume that the recorded sound is getting overloaded when digitized (bit- and sample rate too low) and therefore the microphone automatically adapts the volume.
    – Robert
    Jul 2, 2020 at 7:28

0

You must log in to answer this question.

Browse other questions tagged .