natiny.audio.source_set_loop

Lua
natiny.audio.source_set_loop(source, loop)

Sets whether a source repeats after reaching its end.

Parameters

Name Type Description
source number Source handle
loop boolean Whether playback should repeat

Example

Lua
natiny.audio.source_set_loop(source, true)

Notes

  • Sources do not loop by default. Changing this setting does not change the current playback position or start playback.
  • The mixer joins the last sample directly to the first; seamless sound therefore requires a loopable source file.
  • Invalid and non-source handles are ignored.