I am writing an iPad application that uses the Flite text-to-speech engine to announce specific events. The Flite engine uses an instance of AVAudioPlayer to play speech sound after it is created. For fun, I decided to add some simple controls to the application to allow the user to control the playback of the iPod (hereinafter, the previous, play / pause and volume are the basics), while my application works using MPMusicPlayerController (of course).
The problem I am having is that when I adjust the volume of the iPod using MPMusicPlayerController, all my sounds are affected, including other sound effects and speech sound. I set the volume for these other audio players (instances of AVAudioPlayer) to 1.0 before playing the sound, but it seems that the volume is always limited to what is set for the iPod speaker ...
This is normal? And what can I do to get around this? I want the sound of my application to play at the system level, regardless of the volume level of the iPod. (Example: a user has set the system volume to 80% of the maximum number of devices. I want my application to play audio at 100% of this 80%, allowing the user to set iPod audio playback to 0-100% of this 80%.) Note. I'm not interested in "dodging", but it also reduces the volume of the iPod while my application is running (background music).
I also have a problem: sometimes, when you first start the application and press the play button on the iPod (which sends a call [play play]), the iPod does not respond. If I press the home button, go to the iPod application and start playing, and then, returning to my application, it works fine. What is the reason for this?
Thanks in advance for your help!
iphone ipad ipod avaudioplayer mpmusicplayercontroller
Vic320
source share