Game Development Community

sounds stop working for anybody if a call is declined?

by Ray Graham · in iTorque 2D · 03/09/2009 (12:49 am) · 4 replies

I just wanted to make sure it's not me. But do you guys have your sound stop working in the game if an incoming call is declined?

#1
03/09/2009 (5:39 pm)
Darn, I guess it's just me then. Lots of debugging for me to do then.
#2
03/09/2009 (5:46 pm)
I would try calling OpenALShutdownDriver() in oniPhoneWillResignActive() and then OpenALShutdownDriver() in oniPhoneBecomeActive().

That way you shut down OpenAL before the call and restart it afterwards, no matter what may happen in between.

Note: oniPhoneBecomeActive() will get called on system startup, you don't want to init audio then, only after returning from inactive, so you'll prolly want to set a $global to keep track of that variable.

EDIT: fixed typos :P
#3
03/09/2009 (5:58 pm)
I'm pretty sure you have some typos in your post, but I get the gist of it. Thanks, I'll try that stuff.
#4
03/09/2009 (7:21 pm)
Mat, what you described definitely works for when the phone is locked and then unlocked: I can successfully stop and restart the audio (as well as pause/unpause the game). However, when the incoming call comes in and it is declined oniPhoneBecomeActive() and oniPhoneResignActive() get called however, the audio still will refuse to start back up on becoming active again.

What is interesting to note is that if I play with the volume controls of the phone after I've declined the call, it's trying to adjust the "ringer volume" and not the speaker volume.

OS 2.2