Set Microphone Gain of ipad/iPhone


#1

Adding a function for changing the microphone gain of iOS devices in the AudioIODevice class would be very helpful and could be implemented very easily...


#2

Yes, that'd probably be a good addition to the SystemAudioVolume class.


#3

I extended the iOSAudioIODevice class locally with the following function:

    bool setMicGain(float gain){
        UInt32 gainAvailable = 0;
        getSessionProperty(kAudioSessionProperty_InputGainAvailable, gainAvailable);
        if(gainAvailable){
            setSessionFloat32Property(kAudioSessionProperty_InputGainScalar, (Float32)gain);
            return true;
        }else{
            return false;
        }
    }