HU/setSoundProperties: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 5: Line 5:
}}
}}


==Syntax==  
==Szintaxis==  
<syntaxhighlight lang="lua">bool setSoundProperties(element sound, float fSampleRate, float fTempo, float fPitch, bool bReverse )</syntaxhighlight>  
<syntaxhighlight lang="lua">bool setSoundProperties(element sound, float fSampleRate, float fTempo, float fPitch, bool bReverse )</syntaxhighlight>  
{{OOP||[[sound]]:setProperties||getSoundProperties}}
{{OOP||[[sound]]:setProperties||getSoundProperties}}
===Required Arguments===  
===Kötelező argumentumok===  
*'''sound:''' a [[sound]] [[element]] that is created using [[playSound]] or [[playSound3D]]
*'''sound:''' egy [[sound|hang]][[element|elem]], amelyet a [[playSound]] vagy a [[playSound3D]] segítségével hozták létre


*'''fSampleRate:''' a [[float]] that defines the new sound's [http://en.wikipedia.org/wiki/Sampling_rate sample rate]
*'''fSampleRate:''' a [[float]] meghatározza az új hang [http://en.wikipedia.org/wiki/Sampling_rate hangminta arányát]


*'''fTempo:''' a [[float]] that defines the new sound [http://en.wikipedia.org/wiki/Tempo tempo]
*'''fTempo:''' a [[float]] meghatározza az új hang [http://en.wikipedia.org/wiki/Tempo tempóját]


*'''fPitch:''' a [[float]] that defines the new sound [http://en.wikipedia.org/wiki/Pitch_%28music%29 pitch]
*'''fPitch:''' a [[float]] meghatározza az új hang [http://en.wikipedia.org/wiki/Pitch_%28music%29 hangmagasságát]


*'''bReverse:''' a [[boolean]] representing whether the sound will be reversed or not.
*'''bReverse:''' a [[boolean]] meghatározza, hogy a hang meg fog-e fordulni, vagy sem


===Returns===
===Visszaadott érték===
Returns ''true'' if the properties sucessfully set, ''false'' otherwise.
Visszaad egy ''true'' értéket, ha a tulajdonságok sikeresen be lettek állítva, egyébként ''false''.


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


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


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

Latest revision as of 20:42, 16 August 2018

Ez a funkció módosítja egy adott hang tulajdonságait.

Szintaxis

bool setSoundProperties(element sound, float fSampleRate, float fTempo, float fPitch, bool bReverse )

OOP Syntax Help! I don't understand this!

Method: sound:setProperties(...)
Counterpart: getSoundProperties


Kötelező argumentumok

  • bReverse: a boolean meghatározza, hogy a hang meg fog-e fordulni, vagy sem

Visszaadott érték

Visszaad egy true értéket, ha a tulajdonságok sikeresen be lettek állítva, egyébként false.

Példa

Click to collapse [-]
Client
function editSongSound()
	local sound = playSound("song.wav", false) -- Play the file 'song.wav' and make it play only once
	setSoundProperties(sound, 48000.0, 128.00, 440.0, false) -- Set its samplerate to 48,000 Hz, tempo to 128.00, pitch to 440 Hz and not reversed
end
addEventHandler("onClientResourceStart", resourceRoot, editSongSound) -- Execute the function when the resource is started

Lásd még

Fordította