For invoking a callback when audio finishes playing in Corona,
function NarrationFinished(event)
if event.completed then
print("Narration completed playback naturally")
else
print("Narration was stopped before completion")
end
end
oldSpeech = audio.loadStream("narrationSpeech.wav")
oldSpeechChannel = audio.play( oldSpeech, { duration=30000, onComplete=NarrationFinished } )
–it will play the audio on any available channel, for at most 30 seconds, and invoke a callback when the audio finishes playing




