HU/getSoundSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
Ez a funkció a megadott [[sound|hang]][[element|elem]] lejátszási sebességének visszaadására szolgál.
Ez a funkció a megadott [[sound|hang]][[element|elem]] lejátszási sebességének visszaadására szolgál.


==Syntax==  
==Szintaxis==  
<syntaxhighlight lang="lua">float getSoundSpeed ( element theSound )</syntaxhighlight>  
<syntaxhighlight lang="lua">float getSoundSpeed ( element theSound )</syntaxhighlight>  
{{OOP||[[sound]]:getSpeed|speed|setSoundSpeed}}
{{OOP||[[sound]]:getSpeed|speed|setSoundSpeed}}
===Required Arguments===  
===Kötelező argumentumok===  
*'''theSound:''' the [[sound]] [[element]] which playback speed you want to return.
*'''theSound:''' the [[sound]] [[element]] which playback speed you want to return.


===Returns===
===Visszaadott érték===
Returns an [[float]] value indicating the playback speed of the [[sound]] [[element]]. Default sound playback speed is '''1.0'''.
Returns an [[float]] value indicating the playback speed of the [[sound]] [[element]]. Default sound playback speed is '''1.0'''.


==Example==  
==Példa==  
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">

Revision as of 11:38, 19 July 2018

Ez a funkció a megadott hangelem lejátszási sebességének visszaadására szolgál.

Szintaxis

float getSoundSpeed ( element theSound )

OOP Syntax Help! I don't understand this!

Method: sound:getSpeed(...)
Variable: .speed
Counterpart: setSoundSpeed


Kötelező argumentumok

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

Visszaadott érték

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

Példa

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)

See Also