HU/getSoundProperties: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(12 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{Client function hu}}
{{Client function hu}}
{{New feature/item|3.0130|1.3.0|4097|
{{New feature/item|3.0130|1.3.0|4097|
Ez a funkció egy [[sound|hang]] sajátos tulajdonságát adja vissza.
Ez a funkció egy [[sound|hang]] sajátos tulajdonságát kapja meg.
}}
}}


Line 14: Line 14:
Ez a fuknció visszaad 3 [[float|float]] és egy [[boolean|logikai]] értéket:
Ez a fuknció visszaad 3 [[float|float]] és egy [[boolean|logikai]] értéket:


Az első 'float' az a hang[http://en.wikipedia.org/wiki/Sampling_rate sample rate| minta aránya], the second one the sound's [http://en.wikipedia.org/wiki/Tempo tempo], and the third one the [http://en.wikipedia.org/wiki/Pitch_%28music%29 pitch] of the sound. The boolean representing whether the sound is reversed or not.
Az első [[float|float]] az a [http://en.wikipedia.org/wiki/Sampling_rate hangminta] arányát adja vissza, a második az a hang [http://en.wikipedia.org/wiki/Tempo sebességét], a harmadik pedig a [http://en.wikipedia.org/wiki/Pitch_%28music%29 hangmagasságot]. A logikai érték pedig azt fejezi ki, hogy a hang megfordult-e, vagy sem.


==Példa==  
==Példa==  
'''Péda 1:''' This example would return three float values representing the sample rate, tempo, pitch and a boolean value representing whether the sound is reversed or not, every 5 seconds.
'''Péda 1:''' Ez a példa visszaad 3 float értéket, a hangmintát, a sebességet, a hangmagasságot és a logikai érték pedig azt, hogy a hang megfordult-e vagy sem minden ötödig másodpercben.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local sound  
local sound  
Line 35: Line 35:
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==Lásd még==
{{Client_audio_functions hu}}
{{Client_audio_functions hu}}


[[en:getSoundProperties]]
[[en:getSoundProperties]]
[[ar:getSoundProperties]]
[[ar:getSoundProperties]]
==Fordította==
* '''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]'''''

Revision as of 20:39, 16 August 2018

Ez a funkció egy hang sajátos tulajdonságát kapja meg.

Szintaxis

float, float, float, bool getSoundProperties( element sound )

OOP Syntax Help! I don't understand this!

Method: sound:getProperties(...)
Counterpart: setSoundProperties


Kötelező argumentumok

Visszaadott érték

Ez a fuknció visszaad 3 float és egy logikai értéket:

Az első float az a hangminta arányát adja vissza, a második az a hang sebességét, a harmadik pedig a hangmagasságot. A logikai érték pedig azt fejezi ki, hogy a hang megfordult-e, vagy sem.

Példa

Péda 1: Ez a példa visszaad 3 float értéket, a hangmintát, a sebességet, a hangmagasságot és a logikai érték pedig azt, hogy a hang megfordult-e vagy sem minden ötödig másodpercben.

local sound 
local timer

addCommandHandler("playsound",
function () 
    sound = playSound("wasted.mp3")
    timer = setTimer(function() soundProperties(sound) end, 5000, 0)
end
)

function soundProperties(sound)
    local sampleRate, tempo, pitch, isReversed = getSoundProperties(sound) --gets the sample rate, tempo, pitch and a boolean value representing whether the sound is reversed or not.
    outputChatBox(sampleRate.." "..tempo.." "..pitch.." "..tostring(isReversed))
end

Lásd még

Fordította