audio_system

Checks whether the legacy sound or normal audio is in use.

Syntax:

audio_system();


Returns: Constant


Description

This function returns whether the current sound system is the legacy or the normal one. The return value can be one of the following two constants:

ConstantDescription
audio_old_systemthe legacy sound system is in use
audio_new_systemthe normal sound system is in use


This function is important only if you are using the HTML5 target module, as some browsers are not compatible with the new audio system, and so GameMaker: Studio will automatically switch back to the legacy audio.


Example:

if audio_system() == audio_old_system
   {
   global.SS = false;
   }
else
   {
   global.SS = true;
   }

The above code checks to see if the sound system being used is the legacy or the new one, and sets a global variable accordingly.


Back: Audio
Next: audio_exists

© Copyright YoYo Games Ltd. 2018 All Rights Reserved