audio_sound_set_track_position

Set a time position for a sound to play from.

Syntax:

audio_sound_set_track_position(index, time);


Argument Description
index The index of the sound to change.
time The time (in seconds) to set the start point to.


Returns: N/A


Description

This function will set the position (in seconds) within the sound file for the sound to play from. The sound can either be a single instance of a sound (the index for individual sounds being played can be stored in a variable when using the audio_play_sound or audio_play_sound_at functions) or a sound asset. If it is a unique sound ID that you use, then the position will change immediately to the new time given, and if it is a resource tree asset then all further plays of the given sound will start at the new time. The function will ignore any value given that is longer than the length of the sound given for the "index" value.


Example:

var snd = audio_play_sound(snd_MainTrack, 0, false);
audio_sound_set_track_position(snd, 32);

The above code plays a sound and then uses the returned ID value to set the start position for the sound to 32 seconds.


Back: Audio
Next: audio_sound_get_track_position
© Copyright YoYo Games Ltd. 2018 All Rights Reserved