Sign in to follow this  
Multiverse

Music playing during call interrupt (Nokia 6630)

Recommended Posts

Hi guys, I have a problem that if you accept a call interrupt while my theme music is playing, you can hear the them music in the background during the call. The reason for this (i suspect) is because if I receive a hideNotify() event, I stop all sound, and then restart the sound in showNotify(). The problem is that on the 6630, when a call is accepted, the midlet is brought back into the foreground so I assume a showNotify() event occurs. Are there any other events that occur when a phone call is accepted/ended, that I can test for to decide when to restart my music/sound? Thanks for reading! Multi

Share this post


Link to post
Share on other sites
I'm not aware of any other events to let you know when the call ended.

But if you look at most games you'll notice that after the game has been paused for whatever reason (a pauseApp() or hideNotify()), it usually comes back in a paused state, and waits for some kind of user input before unpausing itself. That would probably solve your problem.

shmoove

Share this post


Link to post
Share on other sites
you may also use a certain unorthodox method: in the thread loop, compute the time difference between two frames. if the time difference is greater than a value (usually between 1-3 seconds), it is possible that the phone sent the app to background and you have to pause your game. i dont master low-level java machine behaviour, but i assume that the thread execution is not paused but slowered, thus allowing the application to detect such changes.

also take care that having a "blocking" game loading will trigger the process described above [wink]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this