Audio

Syntax

Command Description Return Value
Audio "<filename>" Plays the given sound file The file name being played
Audio Stop Stops playing sound immediately Always returns 0
  • <filename>
    • The file name of a sound resource loaded into Sounds
    • Sound formats recognized include: .aif, .mp3, .ogg, .snd, and .wav

Abbreviation

None

Description

Playing Sounds

The Audio command will play a given sound resource file to the Audio Output jack. The sound plays asynchronously, meaning that the command returns immediately while the sound plays in the background until it is finished, or it is interrupted by the Audio Stop command.

If a sound was already playing, issuing another Audio command will immediately stop playing the previous sound and begin playing the new sound.

Stopping Sounds

The Audio Stop command will immediately stop any sound that is currently playing.

Examples

Audio "Sound Effect.wav"
Begins playing the Sound Effect.wav sound resource file.

Audio "Background Music.mp3"
Begins playing the Background Music.mp3 sound resource file.

Audio Stop
Stops playing sound immediately.