sound_get_name

Returns the resource name of the given sound.

Syntax:

sound_get_name(index);


Argument Description
index The index of the sound to check.


Returns: String


Description

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().


Example:

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.


Back: Legacy Sound
Next: sound_play
© Copyright YoYo Games Ltd. 2018 All Rights Reserved