natiny_audio_init
int natiny_audio_init(void);
Opens the audio output device and starts the mixer.
Returns
| Type | Description |
|---|---|
int |
1 when audio output opened, otherwise 0 |
Example
int 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 return1. - 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_loopframe callback. - On web, audible output may remain suspended until the user interacts with the page because of browser autoplay policies.