natiny.audio.shutdown

Lua
natiny.audio.shutdown()

Stops audio output and clears all audio sources and listeners.

Example

Lua
natiny.audio.shutdown()

Notes

  • Source and listener handles become invalid for the audio API. To resume audio, call natiny.audio.init and create new sources and listeners.
  • Clips remain valid and can be reused after audio is initialized again. Destroy them separately with natiny.clip.destroy.
  • The entity nodes that back sources and listeners are not destroyed by this call. Use natiny.audio.source_destroy and natiny.audio.listener_destroy before shutdown if their entity handles must also be invalidated.
  • natiny.backend.shutdown already performs audio shutdown and also destroys all clips.
  • Calling this without an open audio device is safe and still clears sources and listeners.