audio.play doesn’t work as advertised
– initialize and play song1 on channel 1
local bm=audio.loadStream(“song1.mp3”,system.ResourceDirectory)
local pbm=audio.play( bm, { channel=1, loops=-1, fadein=5000 } )
– time passes and later you’d like to stop and dispose of the song on channel 1,
– so that you can reuse the same channel 1 for another song (BUT THIS DOESN’T WORK’)
audio.stop(pbm)
pbm=nil
audio.dispose(bm)
bm=nil
local bm2=audio.loadStream(“song2.mp3”,system.ResourceDirectory)
local pbm2=audio.play( bm2, { channel=1, loops=-1, fadein=2000 } )