IPhone volume has changed for volume already max

I use

AudioSessionAddPropertyListener (kAudioSessionProperty_CurrentHardwareOutputVolume, audioVolumeChangeListenerCallback, self);

to detect volume changes so that I can take a picture with the volume speakers, but if the phone is already 100%, I do not receive the event. Is there a way to detect the speaker volume pressed when the volume does not actually change?

+1
iphone
Jun 27 2018-10-22T00:
source share
2 answers

Well, you can set the volume lower after you have registered a press of the volume button to take a picture. Thus, the volume does not reach 100%, and you can continue to receive callbacks. Remember to lower the volume by more than one volume with the touch of a volume button.

You want to be careful to use some method to prevent multiple notifications from being received at the same time, but you probably already do this if you only take one photo on the click button.

I think that I am going to implement this function (I do not think it was necessary, but now I like the idea) in my application and I will send the code if I get it working, let me know if you also get your work.

0
Sep 13 '10 at 17:39
source share
— -

I found a good full source code answer here :

When the user presses the volume buttons in your application, you do not want the volume of the system to change. It would suck for them to take pictures and the volume of their ringtone completely or something like that.

So how can I take this off? These are pretty hacks, but it works.

0
Nov 02 '13 at 9:13
source share



All Articles