natiny_audio_source_set_pitch

C
void natiny_audio_source_set_pitch(NatinyAudioSource source, float pitch);

Sets a source's playback-speed and pitch multiplier.

Parameters

Name Type Description
source NatinyAudioSource Source handle
pitch float Multiplier; 1.0f uses the recorded speed

Example

C
natiny_audio_source_set_pitch(source, 1.25f);

Notes

  • 2.0f plays twice as fast and one octave higher; 0.5f plays half as fast and one octave lower.
  • Values are clamped to 0.05f .. 16.0f. Changing pitch does not restart the source.
  • Invalid and non-source handles are ignored.