My app has an audio loop that plays during the main menu, and a different audio loop(s) for the game play. When going back to the main menu my app crashes when I do this:
playLoop("audio\_menuloop.mp3");
the playLoop function looks like this:
function playLoop(snd)
audio.stop();
audio.dispose( loopMusic );
loopMusic = nil;
loopMusic = audio.loadStream ( snd );
audio.setVolume( 1, { channel=loopChannel } );
audio.play( loopMusic, { channel=loopChannel, loops=-1, fadeIn=500 } );
return;
end
Interestingly, it doesn’t crash when going from the main menu to the game play. What am I doing wrong? How do you guys handle this situation? Here’s some crash output:
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 com.yourcompany.SDL-sound 0x001b2bfa Sound\_FreeSample + 93
1 net.playcontrol.ALmixer 0x00180e65 Internal\_FreeData + 48 [import]uid: 52127 topic_id: 12867 reply_id: 312867[/import]