Pausing external music but allowing user to resume it

Hi,

I’m currently building a game which has a lot of sounds, so I’d like the external audio to be paused when the game is launched, but I’d like the user to be able to hit play again on the command center if he/she desires so.

My status so far: I’ve managed the part of being able to play external music during the game, but I can’t seem to find any answers as to how I go about pausing it as the app is launched.

I am just building for iOS for now, so if there’s an iOS exclusive solution, that’s fine, but if there’s a universal solution, even better :slight_smile:

tyvm

External audio should pause unless you’ve done something to cause it to not pause (an undocumented settings for mix modes).

I don’t know if the iTunes plugin would let you resume music or not.

Rob

I’m using:

if audio.supportsSessionProperty == true then     print("supportsSessionProperty is true")     audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode) end

cause I couldn’t play my music during the game, even if I tried to press play during game from the command center. But now I can’t pause it when I launch the game, which is what I want.

I don’t think you can have it both ways.  Perhaps you should over them a setting that lets them choose if they want to play music during play or not and only set the mix mode if they opt in for it.

Rob

is there anyway I can detect if music is playing then?

Not that I know of.

External audio should pause unless you’ve done something to cause it to not pause (an undocumented settings for mix modes).

I don’t know if the iTunes plugin would let you resume music or not.

Rob

I’m using:

if audio.supportsSessionProperty == true then     print("supportsSessionProperty is true")     audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode) end

cause I couldn’t play my music during the game, even if I tried to press play during game from the command center. But now I can’t pause it when I launch the game, which is what I want.

I don’t think you can have it both ways.  Perhaps you should over them a setting that lets them choose if they want to play music during play or not and only set the mix mode if they opt in for it.

Rob

is there anyway I can detect if music is playing then?

Not that I know of.