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.
  • If no output device is available, other audio calls remain safe and may still create handles, but produce no audio.
  • The mixer operates at 48 kHz. Source and listener transforms are published after each natiny.backend.loop frame callback.
  • On web, audible output may remain suspended until the user interacts with the page because of browser autoplay policies.