natiny.audio.source_set_pitch

Lua
natiny.audio.source_set_pitch(source, pitch)

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

Parameters

Name Type Description
source number Source handle
pitch number Multiplier; 1.0 uses the recorded speed

Example

Lua
natiny.audio.source_set_pitch(source, 1.25)

Notes

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