natiny_audio_source_seek

C
void natiny_audio_source_seek(NatinyAudioSource source, float seconds);

Sets a source's playback position.

Parameters

Name Type Description
source NatinyAudioSource Source handle
seconds float Position in seconds from the beginning

Example

C
natiny_audio_source_seek(source, 30.0f);

Notes

  • The position is clamped to 0.0f .. natiny_clip_get_duration(clip) of the clip the source plays. A source with no clip cannot be seeked.
  • Seeking does not change whether the source is playing or paused.
  • Invalid and non-source handles are ignored.