audio_get_type

Returns the type of audio for the given sound.

Syntax:

audio_get_type(index);


Argument Description
index The index of the sound to check.


Returns: Real


Description

When adding audio to GameMaker: Studio it can be either streamed or in memory. If you need to know whether a given sound index is for streamed audio or not you can use this function which will return 1 for streamed, 0 for sound in memory, and -1 if there is any error or the index does not point to a valid sound resource.


Example:

type = audio_get_type(snd_Music_1);

The above code checks the type of audio indexed in the variable "snd_Music_1" and stores the returned value in the variable "type".


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