Home  Contents

audio.play

Audio Core4 Lua Commands

SYNOPSIS

  1. audio.play(filename)
  2. audio.stop()
  3. audio.sync()

DESCRIPTION

The command audio.play() passes the filename given to the audio daemon to play.
If no audio daemon is running, nothing happens. Supported file types are uncompressed WAV and Ogg-Vorbis.

The audio.stop() command aborts any currently playing audio file. Due to buffering, the exact timing of this abort operation is undefined.

If another play command is given while a file is already playing, a stop command is processed first.

The audio.sync() tells the audio daemon to block until any currently playing file has finished playing. The audio daemon stops processing any further commands until the current playback finishes.
This does not block the Lua program from running. The audio daemon is a separate process.
While waiting, the audio daemon is not processing any commands. Stopping the playback is no longer possible.
The stop command would simply be queued till the wait ends and run when there is no longer any playback happening.

EXAMPLE

audio.play("/etc/buzz.ogg")

SEE ALSO