Audio Actions Library

Audio Actions

GameMaker Studio 2 has a complete audio engine that is based on the *.ogg, *.mp3 and *.wav sound formats. Sounds of these types added to the IDE can then be used in your game using the basic audio functions shown below. For things more complex than basic sound effects or playing a single piece of music you can refer to the advanced audio functions which let you modify how a sound is played. There are also a selection of more specialised functions dedicated to streaming audio, positioning audio - to give 3D sound - and grouping audio.

IMPORTANT! When using audio on the HTML5 target, you should be aware that not all browsers support Web Audio and so may not play any sound for your project when run. You can get a general idea of Web Audio support from the following link: Can I Use Web Audio?.

The Audio library has the following actions:

Play Audio Play Audio
Stop Audio Stop Audio
Stop All Audio Stop All Audio
Pause Audio Pause Audio
Pause All Audio Pause All Audio
Resume Audio Resume Audio
Resume All Audio Resume All Audio
Set Audio Position Set Audio Position
Get Audio Length Get Audio Length
Set Audio Pitch Set Audio Pitch
Get Audio Pitch Get Audio Pitch
Set Audio Volume Set Audio Volume
Get Audio Volume Get Audio Volume
Set Master Volume Set Master Volume
Get Master Volume Get Master Volume
If Audio Is Playing If Audio Is Playing
If Audio Is Paused If Audio Is Paused