Removing mic processing


#1

Hi all, just thought I'd pop the Q if anyone has had any experience with it: I'm doing a recording application, however I need the processing on the mic removed (no noise gate/AGC etc.).

There is the VOICE_RECOGNITION flag (http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html#VOICE_RECOGNITION) but I have no clue as how to apply it on the audio session used in JUCE, if even possible ?

Any hints appreciated!

 


#2

Got this response on the android audio list:

On most devices you can achieve this when setting the microphone source to VOICE_RECOGNITION. To do this via the OpenSL interface you have to request the SL_IID_ANDROIDCONFIGURATION interface from the audio recorder object and then set the SL_ANDROID_KEY_RECORDING_PRESET to voice recognition.

These lines should help you if you already have a working OpenSL example.

(*m_engineEngine)->CreateAudioRecorder(m_engineEngine, &m_recorderObject, ... );

(*m_recorderObject)->GetInterface(m_recorderObject, SL_IID_ANDROIDCONFIGURATION, &m_androidConfiguration);

(*m_androidConfiguration)->SetConfiguration(m_androidConfiguration, SL_ANDROID_KEY_RECORDING_PRESET, SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION , sizeof(SLint32) );

Unfortunately some devices ignore this, and still apply some processing (AEC,NS,AGC), even though you've set the mic source to voice recognition, but for the majority it works. 

Interesting. 

Jules, this would require that there would be some way to open an AudioIODevice with an optional set of arguments, like f.i.


    virtual String open (const BigInteger& inputChannels,
                         const BigInteger& outputChannels,
                         double sampleRate,
                         int bufferSizeSamples,
                         const StringPairArray& optionalArgs = StringPairArray() ) = 0;

where optionalArgs for this particular feature would be:

"InputPreprocessing" = "OFF"

For iOS, there is a similar feature, which is why the optional args stuff would be great :)

 


#3

Yeah, someone posted some code to do this on iOS too and it's been sitting in my in-box waiting for me to have time to look at it. I'll probably just add something to the AudioIODevice base class to make this setting accessible.


#4

Thanks guys - I've added some code that should do this now, but I don't have a test-case for it so any feedback would be appreciated!


#5

Hi Jules, this seems to be working fine on two tested mobiles so far, an LG Optimus G and a Nexus4. Thanks!