AR/getSoundSpeed

From Multi Theft Auto: Wiki
Revision as of 03:34, 6 May 2013 by Tete (talk | contribs) (Created page with "__NOTOC__ {{Client function}} This function is used to return the playback speed of the specified sound element. ==Syntax== <syntaxhighlight lang="lua">float getSoundSpeed ( element theS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is used to return the playback speed of the specified sound element.

Syntax

float getSoundSpeed ( element theSound )

Required Arguments

  • theSound: The sound element which playback speed you want to return.

Returns

Returns an float value indicating the playback speed of the sound element. Default sound playback speed is 1.0.

Example

Click to collapse [-]
Client
function outputSpeed(soundname) 
	local sound = playSound("sounds/"..tostring(soundname)..".mp3") --Play the sound from the sounds folder
	setSoundVolume(sound, 0.5) -- set the sound volume to 50%
	outputChatBox("The sound speed : "..getSoundSpeed(sound)) -- output the sound speed
end
addCommandHandler("soundspeed",outputSpeed)

أنظر أيضاً