natiny.clip.destroy

Lua
natiny.clip.destroy(clip)

Frees a clip's decoded audio.

Parameters

Name Type Description
clip number Clip handle

Example

Lua
natiny.clip.destroy(clip)

Notes

  • Do not use the clip handle after destroy.
  • Sources still pointing at the clip play nothing. They are not destroyed and stay usable: give one another clip with natiny.audio.source_set_clip.
  • Clips are not reference counted. Destroying one while sources play it is safe - the samples are held until the mixer has been seen to let go of them - but it silences those sources.
  • natiny.audio.shutdown leaves clips alone; natiny.backend.shutdown destroys them along with the rest of the engine state.
  • Invalid and already destroyed handles are ignored.