AudioChannel* AudioClip.Play(optional AudioPriority, optional RepeatStyle)
Optionally you can supply a priority and Repeat setting; if you do not supply these, the defaults set for the audio clip in the editor will be used.
This command searches through all the available audio channels to find one that is available for this type of audio. If no spare channels are found, it will try to find one that is playing a clip with a lower or equal priority, and interrupt it to replace it with this new sound.
If all audio channels are busy playing higher priority sounds, then this new audio clip will not be played.
This command returns the AudioChannel instance that the new sound is playing on, or null if it did not play for any reason.
NOTE: AGS can only play one MIDI file at a time.
Example:
Code: ags
Compatibility: Supported by AGS 3.2.0 and later versions.
Optionally you can supply a priority and Repeat setting; if you do not supply these, the defaults set for the audio clip in the editor will be used.
This command searches through all the available audio channels to find one that is available for this type of audio. If no spare channels are found, it will try to find one that is playing a clip with a lower or equal priority, and interrupt it to replace it with this new sound.
If all audio channels are busy playing higher priority sounds, then this new audio clip will not be played.
This command returns the AudioChannel instance that the new sound is playing on, or null if it did not play for any reason.
NOTE: AGS can only play one MIDI file at a time.
Example:
aExplosion.Play();
Compatibility: Supported by AGS 3.2.0 and later versions.