audio.play( file ) method


Plays the specified sound.

Parameters

file

A File or a filename as a string representing the file to load the sound from.

This function provide the simplest but least flexible way to play a sound.
For more flexibility and possibilities, you can use a Sound object.

Return value

This function returns no value.

Example

local audio = require "audio" local console = require "console" -- loads a explosion sound audio.play("boom.wav") console.writecolor("red", "BOOOUUUM !!!\n")