on_sound_interrupted

Description

This event is fired every time a sound finishes playing because it was stopped by the user (either by closing the page that generated the sound or some other means). If the sound finishes playing normally, then the on_sound_done event is fired.

See also

on_sound_done

Example

script explain is
  explaining := True
  play_wave_file ('explanation' . current_item_index)
end

script on_sound_done is
  if explaining then
    -- user sets explaining to true before
    -- playing an explanation sound. When the
    -- sound finishes, go to the next question
    next
  end
end

script on_sound_interrupted is
  if explaining then
    -- sound was interrupted, assume they went to
    -- some other page
    explaining := False
  end
end