setSoundProperties
Client
Changes a sound's sample rate, tempo and pitch, and whether it plays backwards.
bool setSoundProperties(sound sound, float sampleRate, float tempo, float pitch [, bool reversed = false])
Parameters
| Name | Type | Description |
|---|---|---|
| sound | sound | The sound element, or a dui element for the browser's sound. |
| sampleRate | float | Sample rate in Hz, between 0.05 and 50 times the file's own. |
| tempo | float | Tempo change in percent, from -95 to 5000. 0 keeps the tempo. |
| pitch | float | Pitch change in semitones, from -60 to 60. |
| reversed | bool | Play the sound backwards.default false |
Returns
true if the sound was found, false otherwise.
Example
local music = playSound("sounds/track.mp3")
local rate = getSoundProperties(music)
setSoundProperties(music, rate, 10, -2)NoteA value outside its range is silently ignored and the previous one stays.