setSoundSpeed | Multi Theft Auto: Wiki Skip to content

setSoundSpeed

Client-side
Server-side
Shared

Pair: getSoundSpeed

This function can be used to change the playback speed of the specified sound element.

OOP Syntax Help! I don't understand this!

  • Method: sound:setSpeed(...)
  • Variable: .speed

Syntax

bool setSoundSpeed ( sound/player theSound, float speed )
Required Arguments
  • theSound: The sound element which speed you want to modify.
  • speed: A floating point number representing the desired sound playback speed.

Returns

  • bool: result

Returns true if the sound element playback speed was successfully changed, false otherwise.

Code Examples

client
function soundFunc()
local sound = playSound ( "/sounds/jizzy.mp3",true) -- Let's play a sound
setSoundSpeed ( sound, 1.2 ) -- And it will be a little bit faster !
end
addCommandHandler("play",soundFunc)