User Tools

Site Tools


play_sound

This is an old revision of the document!


Play Sound


Plays the specified sound effect once.

Signature:

play_sound(sound_name, loop, interval)
ArgumentDescriptionTypeRequired
sound_nameName of the sound effect to play.StringYes
loop.BooleanNo
interval.NumberNo
Return ValueDescriptionType
Sound IDReturns a unique numeric ID that can be stored for later reference (e.g. to stop a looping sound via the Stop Sound function.Number

The built-in Sound FX Generator, accessed from the main toolbar along the top of the application, can be used to generate some basic 8-bit style sound effects.

Example:

play_sound("alarm", true, 1);

Results: Plays the sound effect named “alarm” once every second until stopped.

Use the Play Sound function to trigger a sound effect when the player opens a door or a treasure chest, or an event occurs that you'd like the player to hear regardless of their location.


Editor Node:

play_sound.1706764934.txt.gz · Last modified: 2024/01/31 21:22 by justin