Stop onComplete audio callback

Hi Rob, we talked about this issue where onComplete within audio statements engages even when the audio that is set to play has been disposed. Your suggestion (which works) is to create a flag variable to check whether the audio had already been disposed. Obviously doing this flag check is more of a work around but this morning I read this in the 2013.1146 release notes of the Daily Build:

Core - fix various crashes associated with
disposing of audio streams; issue error messages when invalid (usually
previously disposed) streams are passed to various audio. APIs - fixes
casenum 24229 et al

Does this fix our wild onComplete issue?

I’m not sure and I’ve not tested it, but it sounds like that might take care of it.

In onComplete, try using the e.completed?

If the sound is stop by audio.stop() when the sound won’t finish playing the e.completed could return false.

If you don’t need to excecute the code in onComplete try using a code like:

audio.play(“test.mp3”,{channel = 1, onComplete =

function(e)

if e.completed then

–Somethingelse–
 

end

end})

Sorry if I was misunderstand.