I got this to work sort of, music suspends when app is launched, but the music can be manually restarted after the app launches/ It sure a lot better than nothing. My game is a card game and I can still easily hear the game beeps/sounds with the music playing.
--------code to allow Native music to play in background!!!!
--I put this towards the top of main.lua
--When app lauches, the music still fades out but can atleast be restarted and played while in app
-- If another app/iPod is playing background music, then allow that music to continue playing,
-- otherwise, play my own background music
if audio.getSessionProperty( audio.OtherAudioIsPlaying ) == 1 then
audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode)
end
--ME...not really sure what the code below does, maybe preserves vol, maybe nothing, but I left it
-- Backdoor trick (we will not support this):
-- If you do some research, you can learn that Apple's constant for
-- kAudioSessionProperty\_CurrentHardwareOutputVolume
-- is 1667788662. As an implementation detail, our API currently will pass numbers through.
-- Note kAudioSessionProperty\_CurrentHardwareOutputVolume is a read-only property.
local master\_ringer\_volume = audio.getSessionProperty(1667788662)
Hope this helps.
Nail [import]uid: 106779 topic_id: 30438 reply_id: 122178[/import]