HU/setSoundProperties: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 17: Line 17:
*'''fPitch:''' a [[float]] meghatározza az új hang [http://en.wikipedia.org/wiki/Pitch_%28music%29 hangmagasságát]
*'''fPitch:''' a [[float]] meghatározza az új hang [http://en.wikipedia.org/wiki/Pitch_%28music%29 hangmagasságát]


*'''bReverse:''' a [[boolean]] meghatározza, hogy a hang megfordult-e, vagy sem..
*'''bReverse:''' a [[boolean]] meghatározza, hogy a hang meg fog-e fordulni, vagy sem


===Visszaadott érték===
===Visszaadott érték===
Line 40: Line 40:


==Fordította==
==Fordította==
Surge
* '''''[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