sound_get_name(index);
Argument | Description |
---|---|
index | The index of the sound to check. |
Returns: String
This function will return the name of the given resource as a
string. Please note that this is only a string and
cannot be used to reference the sound directly - for that you would
need the sound index. You can, however, use this string to
get the sound index using the returned string along with the
function asset_get_index().
var title;
title = sound_get_name(global.Music);
draw_text(32, 32, "Now Playing:" + title);
The above code gets the name of the sound resource indexed in the global variable "Music" and then displays it on the screen.