audio.rate
rate(sound_name: string, rate: number, id: number) → {number}
get or set the rate of playback for a sound.
// get the playback rate of the background music
let rate = me.audio.rate("dst-gameforest");
// speed up the playback of the background music
me.audio.rate("dst-gameforest", 2.0);
Name | Type | Attributes | Description |
---|---|---|---|
sound_name | string |
audio clip name - case sensitive |
|
rate | number |
<optional> |
playback rate : 0.5 to 4.0, with 1.0 being normal speed. |
id | number |
<optional> |
the sound instance ID. If none is passed, all sounds in group will be changed. |
Type | Description |
---|---|
number |
return the current playback rate (if no extra parameters were given) |