natiny.audio.init

Lua
natiny.audio.init() -> ok

Opens the audio output device and starts the mixer.

Returns

Type Description
boolean true when audio output opened, otherwise false

Example

Lua
local audio_available = natiny.audio.init()

Notes

  • Call this after natiny.backend.init, because backend initialization resets all engine state. Repeated successful calls do nothing and return true.
  • On web, audible output may remain suspended until the user interacts with the page because of browser autoplay policies.