audio_sound_loop_start

This function sets the loop start point in seconds for the given sound asset or sound instance.

See: Audio Loop Points

NOTE The loop start point should be before the loop end point. 0.0 indicates the start of the sound.

 

Syntax:

audio_sound_loop_start(index, time);

ArgumentTypeDescription
indexSound Asset or Sound Instance IDThe sound asset or sound instance for which to set the loop start time
timeRealThe loop start 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.