views:

170

answers:

1

My application is running some internal audio short files, per need. When that happens and if iPod music is on in the background, I stop it, play my sound, then continue it. all using [MPMediaMusicController iPodMusicPlayer].

Now, I want to add the ability to pick and play iPod music from inside my app. Currently, picking of the iPod music is done on one view controller and my sounds kick in on another view controller. My audio session is init-ed on the second view controller which effectively kills the picked iPod music.

Q: What would be best approach to handle both audio sources?

I'm thinking to create the audio session in the AppDelegate and keep it on until it's needed? It's a lot of work to recode from what I already have and I'm not even sure it's the right thing to do.

Has anyone already tackled this problem?

A: 

u need to initialize ur audio session property every time with kAudioSessionCategory_AmbientSound then u can play both the sound

AlexanderDeep