natiny.audio.source_set_clip

Lua
natiny.audio.source_set_clip(source, clip)

Sets which clip a source plays.

Parameters

Name Type Description
source number Source handle
clip number Clip handle

Example

Lua
natiny.audio.source_set_clip(source, footstep_gravel)

Notes

  • Changing the clip stops the source and rewinds it; call natiny.audio.source_play to start the new clip.
  • Setting the clip a source already plays does nothing, and does not interrupt playback.
  • Volume, pitch, loop, spatial and attenuation settings are the source's own and survive the change.
  • Invalid and non-source handles are ignored.
  • A nonzero invalid or destroyed clip handle is stored and produces silence. Lua raises an error when clip is 0.