Help with PhoneStateChanged

solas

Member
Licensed User
Longtime User
Hi all I'm a noob and I'm trying to figure out how to get soundpool player to either pause or stop when the phone is ringing/on a call

I have used the "log PhoneStateChanged demo " and I can see the phone ringing (ect) in the log file, but I can't figure out what would be the correct PhoneStateChanged syntax which would detect PhoneStateChanged and then pause /stop playId
could anyone help with what to put where in the syntax
if PhoneStateChanged ........................= IDLE then
sp.Stop(playId2)
end if
Thanks in advance
Solas
 
Top