This section contains the functions necessary to use the GameMaker: Studio audio API

GameMaker: Studio has a re-vamped audio engine that is based on the *.ogg sound format. You must still load your sounds into the IDE as either *.wav or *.mp3 but you can select compressed audio from the Audio Editor and GameMaker: Studio will convert the sounds to *.ogg (Ogg Vorbis) format when your finished game is compiled. In this way you can keep the final file size of your game to a minimum while ensuring maximum quality. The added benefit of the new GM:S Audio engine is that you now have access to full audio streaming as well as 3D sound with the ability to place a "listener" for all sounds as well as different sound "emitters" to create some stunning special audio effects!

Please note that for compatibility with older projects, GameMaker: Studio still has some legacy audio functionality. However, you cannot have both the new audio engine and the legacy engine active at the same time. For old games created with other versions of GameMaker or for those games started before the new audio engine was added, the Legacy Audio will be used as default, while for all new games GameMaker: Studio will default to the new audio engine. This behaviour can be changed from the Global Game Settings - General Tab.

Basic Audio Functions

The following functions are for dealing with audio in the most straightforward and simple way possible, avoiding the use of emitters and permitting the user to generate sounds and play music easily as these sounds are always generated at the listener position (see below for more details on the listener) and so are generally not affected by any changes to the listener:

Advanced Audio Functions

The following functions are designed to give more control over how the audio engine works, and how the sounds played through it will be "heard" by the listener. As such it is recommended that you have a good working knowledge of how the rest of the GameMaker: Studio audio engine works before using any of the following functions:

Further advanced functionality, like setting listeners, recording audio, or synchronising multiple audio tracks over time can all be found from the sub-sections listed below:

Legacy Sound

The following section also contains information on the Legacy Sound System, provided for compatibility with previous versions of GameMaker and also still of use when dealing with HTML5 and JS games:

The legacy functions are still valid and available due to the fact that certain browsers for HTML5 games do not support the newer sound system. This means that you may wish to check in-game which sound system is actually being used and change the functions being used as appropriate. To that end there is a special function available:

Obsolete Functions

There are also some obsolete audio functions which were designed specifically for music. These functions no longer work and will give an unknown function or script error when they have been used, and you should update any legacy projects that use these functions to use the standard audio_*() functions instead:

Next: Fonts

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here