system.playFile¶
since 1.1.0
Play an audio file.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
audio |
string | yes | file path |
Returns¶
Nothing.
Examples¶
system.playFile("AUDIO:/en/default/system/hello.wav") -- a system voice file
system.playFile("SCRIPTS:/myscript/sounds/armed.wav") -- your own sound: absolute path
From callbacks, use absolute paths: relative paths only resolve to your script folder while main.lua loads (details). Rate-limit anything triggered from wakeup; see Audio.
Real-world usage¶
Called 28 times across 6 open-source Ethos Lua projects. A few short excerpts: