natiny_audio_source_set_clip

C
void natiny_audio_source_set_clip(NatinyAudioSource source, NatinyClip clip);

Sets which clip a source plays.

Parameters

Name Type Description
source NatinyAudioSource Source handle
clip NatinyClip Clip handle

Example

C
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.
  • An invalid or destroyed clip handle is stored and produces silence. Passing 0 clears the clip.