======Play Sound======
----
Plays the specified [[sound|sound effect]]. If the optional loop argument is set to true, the [[sound|sound effect]] will continue to play at the given interval of time (e.g. once per second) until stopped via the [[Stop Sound]] function.
====Signature:====
play_sound(sound_name, loop, interval)
^Argument^Description^Type^Required^
|sound_name|Name of the [[sound|sound effect]] to play.|[[String]]|Yes|
|loop|Whether or not the [[sound|sound effect]] will loop or play only once. When true, it will loop until stopped via the [[Stop Sound]] function.|[[Boolean]]|No|
|interval|Interval of time in seconds to wait between each playing of the [[sound|sound effect]] (only applicable when the loop argument is true).|[[Number]]|No|
^Return Value^Description^Type^
|Sound ID|Returns 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|sound effects]].
====Example:====
play_sound("alarm.wav", true, 1);
//Results:// Plays the [[sound|sound effect]] named "alarm.wav" once every second until stopped.
Use the **Play Sound** function to trigger a [[sound|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_node.png?nolink|}}
~~NOTOC~~