Listening external music or podcast while playing a Corona game

Currently when an application like spotify is playing some music and you open a corona game, it cuts the music and let only the sound of your game, which is painfull as many players like to listen some music or podcast while playing especially during transports.

I’ve done some research and found an undocumented piece of code which not part of the official documentation:

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

But this code is not safe (undocumented), and the first launch of the app still cut the music. You can put app on suspend and the music comebacks and mix your game but this first start disable is kind of annoying.

Also I’ve noticed similar problem when playing an ads especially a rewarded video which cuts the external music on android for example.

Finally I found this old feature request:

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/5416670-allow-external-music-audio-to-keep-playing-in-back

We are in 2019, any chance to see this feature implemented? I think it’s a very important feature, especially when trying to make some hypercasual games where people may more willing to listening music or podcast while playing.

1 Like

Corona is now open source, if someone in the community wants to take up this part of the code and flush it out, go for it. It’s lot likely going to rise to our to-do list any time soon.

Corona is now open source, if someone in the community wants to take up this part of the code and flush it out, go for it. It’s lot likely going to rise to our to-do list any time soon.