audio_sound_loop_end

This function sets the loop end point in seconds for the given sound asset or sound instance. This must be higher than the set loop start point, except when it's 0, which is the end of the sound - this means you can specify 0 to set the loop end point to the end of the sound.

See: Audio Loop Points

 

Syntax:

audio_sound_loop_end(index, time);

ArgumentTypeDescription
indexSound Asset or Sound Instance IDThe sound asset or sound instance for which to set the loop end time
timeRealThe loop end time in seconds

 

Returns:

N/A

 

Example:

audio_sound_loop_start(snd_machine, 4);
audio_sound_loop_end(snd_machine, 10);
ins_sound = audio_play_sound(snd_snd_machine, 100, true);

The above code sets the loop start point for the existing sound asset snd_machine to 4 seconds and the loop end point to 10 seconds. The sound is then played with a priority of 100 and loop set to true. The new sound instance gets its loop start and end position from the sound asset. Its ID is stored in a variable ins_sound.