Changing inputGain on AVAudioSession for iPhone 6s

For a video camera app I want the user to be able to adjust the input gain on the audio.

On iOS8 an iPhone 6 and 5, I used to be able to do this through:


float desiredGain = ...;
NSError *error;
[[AVAudioSession sharedInstance] setInputGain:desiredGain error:&error];


However on an iPhone 6s / iOS9 I am no longer able to do this. AVAudioSession's isInputGainSettable returns NO for this setup.

I am not sure if this is a hardware or an OS issue / change.

Is there a way to adjust the input gain in iPhone 6s / iOS9?

Accepted Reply

No input gain control on 6s. Using isInputGainSettable will let you know if the input ports allow for the ability to set the input gain or not. Check, then do the appropriate thing for each case if you care to. Different hardware will always equal different capabilities over the lifetime of your application.

Replies

No input gain control on 6s. Using isInputGainSettable will let you know if the input ports allow for the ability to set the input gain or not. Check, then do the appropriate thing for each case if you care to. Different hardware will always equal different capabilities over the lifetime of your application.

Thanks for the answer.

Is there any alternative way (API) to control audio recording levels (apart from AVAudioSession's inputGain)?

I want to give users of my app some manual control over the audio levels they record, which I used to be able to do through AVAudioSession.

This sounds REALLY strange ! Starting from iPhone 4s till iPhone 6 this was available but on iPhone 6s this feature is gone ? Why is it so ????

I have the same bug like that.
But I pluged headphone to iphone 6s, isInputGainSettable return YES and input gain control on 6s works.


Sorry for my English.

Five years have passed. And seems still there's same problems.
Or, problems are getting worse.

Last year, I tried to control iPhone6's(not 6s) internal mic gain and SHURE MV-88 external microphone, and I could control both.
But today, I try same thing and IT COULDN'T!!

It always returns false when I checked isInputGainSettable.
I think Apple stopped using these method without any deprecation.
Why does it really matter to set input gain by user?
Without this function, audio developers suffer.
Recording needs to set input gain. Please reconsider this API.

Or, if there's any hacks or alternatives, let me know.

Thanks.