views:

186

answers:

2

I've seen this thread but this is only useful if I wanted the user to pick the volume himself. I wanted my application to change the volume gradually.

Thanks.

+6  A: 

You can't. See this thread

You have to remember that the iPhone is designed as phone first and a computer second. Since phones are emergency communication devices whose functioning can literally be a matter of life and death, any programing functionality that might interfere with phone function is restricted. If a program could override the hardware volume settings it could cause a user to miss a critical call with possibly disastrous consequences. No app needs volume control more than users need their phone.

You can always adjust the output of your app's own sound. The AVAudioPlayer for example has a volume setting. You just can't control the volume of the hardware and other apps.

TechZen
+3  A: 

If you are using AVAudioPlayer to play your sounds, you can just set the volume property.

If you are using AudioServicesPlaySystemSound, then you cant.

Mongus Pong