views:

641

answers:

3

I have a soundboard application that plays mp3 files using AVAudioPlayer. The sound can be adjusted to high while listening to any of the clips.
My problem is when the phone is in use and I navigate to the app to play the soundboard the volume is set very low. I'm trying to make it so the the sound from my app can be heard by the person on the other line. They can currently hear the sound but its very low and hard to make out. Is there a way to raise the volume in my app while the phone is in use?

A: 

Have you tried setting the AVAudioPlayer volume (playback gain) property to 1.0 (max)?

nicktmro
I tried setting the AVAudioPlayer volume to 1.0 right before it plays the sound. It does sound louder but when played during a phone call the volume goes back down. I know its possible because I've seen it on other apps.
ijayson66
A: 

If a phone call is answered, while your app is launched, your app is no longer running until the phone call terminates. At the end of the call you could adjust the AVAudioPlayer volume to 1.0 (100%).

zPesk
yes but what Im trying to accomplish is to play the sound files from my app during a phone call. I do this by placing a call and setting it to speaker, then I press the home button and navigate to my app and launch it. Now I can play the sound files on my app and the other caller can hear them but they sound very low.
ijayson66
A: 

This could be something to do with the hardware volume settings, i.e. when you're in a call the rocker buttons on the side of the phone control the volume of the call. This volume may be controlling the volume of the app as well. May be worth increasing the volume of the call and see if this increases the volume of the app too. If so, then work for a solution to that problem such as implementing an MPVolumeView in the app and customising its behaviour.

imnk