SetSoundSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function sound()
function soundFunc()
sound = playSound ( "/sounds/jizzy.mp3",true) -- Let's play a sound
sound = playSound ( "/sounds/jizzy.mp3",true) -- Let's play a sound
setSoundSpeed ( sound, 1.2 ) -- And it will be a little bit faster !
setSoundSpeed ( sound, 1.2 ) -- And it will be a little bit faster !
end
end
addCommandHandler("play",sound)
addCommandHandler("play",soundFunc)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Revision as of 13:46, 3 April 2011

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

Syntax

bool setSoundSpeed ( element theSound, float speed )

Required Arguments

  • theSound: The sound element which volume you want to modify.
  • speed: A floating point number representing the desired sound playback speed.

Returns

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

Example

Click to collapse [-]
Client
function soundFunc()
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)

See Also