Turning off mixing iPod music

Nibbie
Posts: 1
Joined: 2009.06
Post: #1
I want to do and I can't do following:

Initially, I want to mix iPod music and sound effect, and then on user's action
I want to turn the iPod music off and play my music.

However, in the following code, the iPod music never stops even if I changed the audio session category to solo ambient sound.
I tried in vain other categories such as media playback, record audio and so on.

I appreciate your help.

Initially, mix iPod music and sound effect
Code:
AudioSessionInitialize(0, 0, 0, 0);
UInt32 cat = kAudioSessionCategory_AmbientSound;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof cat, &cat);
AudioSessionSetActive(true);

// Some code using AVAudioPlayer to play sound effects
....

On user's action, turn off iPod music and play my music.
Code:
AudioSessionSetActive(true);
UInt32 cat = kAudioSessionCategory_SoloAmbientSound;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof cat, &cat);
AudioSessionSetActive(true);

// Some code using AVAudioPlayer to play my music
.....
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  problem mixing 3d with 2d render wolfra 0 1,717 Feb 24, 2010 02:14 AM
Last Post: wolfra
  Howto check whether Ipod is playing music Bersaelor 2 4,104 Jan 2, 2010 09:54 AM
Last Post: Bersaelor
  Trouble turning an SDL surface into an OpenGL texture Joseph Duchesne 4 5,505 May 22, 2007 05:14 PM
Last Post: Joseph Duchesne
  Turning Page Effect with OpenGl ReSuMa 3 5,342 May 12, 2007 05:57 AM
Last Post: ReSuMa
  Mixing obj-c and c++ DesertPenguin 2 3,305 Aug 29, 2006 07:47 AM
Last Post: TomorrowPlusX