Control audio volume with hardware buttons while audio is not playing
Hi all, I have an application that plays various audio clips. While the clips are playing, the user can use the hardware volume buttons to adjust the volume. Is there any way to get those hardware buttons to do the same when a sound is not playing?
I am using the AudioToolbox framework. My app works on 2.1 and higher and I'd preferably like to keep it that way (which means I won't be using the AVAudioPlayer framework). Any help or suggestions would be greatly appreciated.
Hi all, I have an application that plays various audio clips. While the clips are playing, the user can use the hardware volume buttons to adjust the volume. Is there any way to get those hardware buttons to do the same when a sound is not playing?
I am using the AudioToolbox framework. My app works on 2.1 and higher and I'd preferably like to keep it that way (which means I won't be using the AVAudioPlayer framework). Any help or suggestions would be greatly appreciated.
I am also interested in getting the hardware buttons to control the sound when a sound is not playing? it works fine when the sound is playing.
I'm also really interested!!!
worst case, at least how to set the application volume to the maximum when the application loads...
I searched in apple docs, but no success.
one thing we could do, but it seems to be a hack, it load a sound that is silent, then tell it to loop, that way there is always something playing in the background then when the user uses there sound buttons it will work.
I would prefer finding a better solution to this issue if we can.
One thing that always bugs me about most apps, is that you cant adjust the volume until the sound starts playing. Like you click the play button, and realize it might be too loud and so try to turn it down with the hardware buttons, but end up just changing the level of the "ringer" volume, and once the sound is done buffering it comes blasting through the headphones.
My app uses audiounits, which I used to start and stop along with the play button and stop button, however this is not recommended by apple. Now I just start the audiounits at program start and stop it at program end, and just pass empty buffers in the audiounit callback. This has the nice side effect of allowing hardware control over volume level at any time the app is running.