audio_sync_group_get_track_pos

Get the current play position for the given sync group.

Syntax:

audio_sync_group_get_track_pos(group_index);


Argument Description
group_index The group index to get the position of.


Returns: Real


Description

This function returns the current play position of the given sync group. The group index is the value returned when you created the group using the function audio_create_sync_group(), and the return value is the time in seconds that the tracks have been playing.


Example:

var real_secs = audio_sync_group_get_track_pos(sg);
var secs = real_secs mod 60;
var mins = string(real_secs div 60);
if (secs > 9)
   {
   secs = string(secs);
   }
else
   {
   secs = "0" + string(secs);
   }
draw_text(32, 32, "Time = " + mins + ":" + secs);

The above code gets the time position for the sync group indexed in the variable "sg", then uses this value to draw the time played on the screen.


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