Pause & UnPause Bg Music

Apprentice
Posts: 17
Joined: 2008.10
Post: #1
At the risk of being chastised for using the old SoundEngine api that came with the now defunct Crash Landing example - I'm looking for some help to Pause and UnPause bg music.

I can not use stop/play because the sound restarts at the beginning.

Anyone happen to have a couple simple methods I can re-use?
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #2
Sorry but the correct answer is to stop using the SoundEngine code. Even if you manage to keep using that for effects (without crashing or leaking) you really should start using AVAudioPlayer for background music.
Quote this message in a reply
Member
Posts: 241
Joined: 2008.07
Post: #3
Or OpenAL. Or FMOD (if you have the $$)
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.10
Post: #4
Aside from the memory leak issue on UnloadEffect (which is very easy to fix) theres nothing wrong with this api. It plays mp3s for bg music and its very easy to use. (And yes, I have managed to use it in a couple games already with no stability or memory issues - feel free to buy them Wink http://www.sumiguchi.com)

But i'm not here to defend it or argue about it. Just wondering if anyone made a pause/unpause functions and would be willing to share.
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #5
I think you missed my point - you can keep using that SoundEngine code for FX if it's working for you (it's just an OpenAL wrapper at that point), but play your music with AVAudioPlayer. It's an Apple API and provides the functionality you need - don't fight it Wink
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.10
Post: #6
Ok.... grrrrr!

It was actually pretty painless to switch over to AVAudioplayer. Haven't done a lot of testing - but so far so good.

Thanks for the tough love Love
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Pause/Resume on IPod touch tonysameh 0 2,327 Jul 26, 2010 06:34 AM
Last Post: tonysameh