Returns the name (as a string) of the given audio resource.



Argument Description
index The index of the sound to check.

Returns: String


This function will return the name of a given audio resource as a string. The "index" value can be that of the resource itself (as seen in the resource tree) or the unique ID value that is given when you play the sound using, for example, audio_play_sound(). Note that the string returned is not the same as the resource ID and cannot be used to access the resource itself, so should only be used for displaying or error checking.


var snd = audio_play_sound(choose(snd_One, snd_Two, snd_Three), 0, false);
var name = audio_get_name(snd);
show_debug_message("Sound = " + name);

The above code plays a random sound chosen from three different sound resources then shows a debug message with its name.

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