I did some digging to try and see how others do it and it seems they use something called Duck. It lowers the volume of the audio from other apps when the running app is playing audio. And I did find that corona “supports” this mode for the audio sessions.
So by setting:
audio.setSessionProperty(audio.OtherMixableAudioShouldDuck, 1)
the music in the background will now automatically fade down abit when my app plays any soud, so that is working good. What does not happen is that it turns the volume back up after the audio from my app is done. So not automatic on that half. Seems there is something you have to do when your audio is done playing. And I dont know if “1” is the correct thing to pass as the value for that matter, but that worked.
I found a page that explains the function of doing this in iOS:
http://www.annacallahan.com/blog/2010/01/21/duck-and-resume-a-little-love-from-the-iphone-music-player/
it refers to two other things at least that I can see that you need to do something about and that is:
AudioSessionSetActive and audioPlayerBeginInterruption/audioPlayerEndInterruption
I found that info for sessions in corona here:
http://developer.coronalabs.com/forum/2011/06/05/new-audiosession-properties
it does mention audio.ActiveMode (corresponds to Apple’s AudioSessionSetActive), but I have no idea how to actually use it like the other page say yet, and not sure about the begin and end interruption functions. So thats kind of where I am stuck right now… so it seems Corona at least half way supports what I want, just not sure if also can get the other half done without Enterprise.
Any help would be awesome!