Get Audio Loop State Icon Get Audio Loop State

This action is used to get the loop state of a sound. You supply a sound, played with Play Audio and the target variable in which to store the result.

 

Action Syntax:

Get Audio Loop State

Arguments:

ArgumentDescription
SoundThe sound of which to get the loop state
TargetThe name of the variable in which to store the state
TempWhether the target variable should be a temporary variable

 

Example:

Set Audio Pitch ActionThe above action block code first checks if the Space key (vk_space) is pressed. If it is, and no instance of the existing sound asset snd_Loop is playing yet, it is played using the Play Audio action. It is played looped (Loop checked) and the sound instance's ID is stored in an instance variable ins_snd_loop.

Next all properties of the playing sound related to audio looping are stored in instance variables: looping, loop_start and loop_end.

Finally the Show Debug Message action is used to output the values of each of these variables. If loop start and end of the sound asset haven't been changed, it will output: 

1
0
0