Audio Functions
akesi lili provides audio functions to manage sound effects and playback, allowing you to add audio feedback and enhance the auditory experience of your game.
sound
|name: String, samples: List, rate: Number|
Creates a sound with the specified parameters.
Parameters
name: The name of the sound.samples: The raw audio samples (a list of numbers).rate: The playback rate of the sound.
Example
sound('beep', [0.5, 0.3, 0.1], 44100)
play
|name: String, volume: Number|
Plays the specified sound at the given volume.
Parameters
name: The name of the sound to play.volume: The volume of the sound. 1.0 is the normal volume.
Example
play('beep', 1.0)
stop
|name: String|
Stops a sound that was started with play.
Parameters
name: The name of the sound to stop.
Example
play('beep', 1.0)
stop('beep')
stop_all
||
Stops all active sounds.
Example
play('beep', 1.0)
play('beep2', 1.0)
stop_all()
These audio functions are essential for adding sound effects and managing audio playback in akesi lili.