I have reduced my code to just this …
if audio.supportsSessionProperty then
audio.setSessionProperty(audio.kMixMode, audio.kMediaPlayback)
end
local backgroundMusic = audio.loadStream( "Frank\_all\_mono.mp3" )
audio.play( backgroundMusic, {channel = 1} )
This runs on my iPhone4 (running iOS5) and on my iPad1 (iOS4.3.3) but on both devices the audio does not continue playing when the screen is locked.
The same is true in the Corona simulator, and when the if statement is commented out I get the following error message
Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.537
The file sandbox for this project is located at the following folder:
(/Users/stefan/Library/Application Support/Corona Simulator/Frankenstein-367AE7E18FFA18C1EE9A69BF11DCCADE)
Runtime error
/Users/stefan/Frankenstein/main.lua:2: Unsupported key: kMixMode in audio library
stack traceback:
[C]: ?
[C]: ?
/Users/stefan/Frankenstein/main.lua:2: in main chunk
Runtime error: /Users/stefan/Frankenstein/main.lua:2: Unsupported key: kMixMode in audio library
stack traceback:
[C]: ?
[C]: ?
/Users/stefan/Frankenstein/main.lua:2: in main chunk
[import]uid: 2646 topic_id: 10882 reply_id: 40582[/import]