RO/getSoundProperties: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0130|1.3.0|4097| Această funcție obține proprietățile unui anumit sound. }} ==Sintaxă== <syntaxhighlight lang="lua">float, float, float, bool getSoundProperties( element sound )</syntaxhighlight> {{OOP||sound:getProperties||setSoundProperties}} ===Argumente necesare=== *'''sound:'''' un sound element care este creat folosind playSound sau playSound3D. ===Returneaza=== Această funcție...") |
(No difference)
|
Latest revision as of 08:02, 2 October 2023
Această funcție obține proprietățile unui anumit sound.
Sintaxă
float, float, float, bool getSoundProperties( element sound )
OOP Syntax Help! I don't understand this!
- Method: sound:getProperties(...)
- Counterpart: setSoundProperties
Argumente necesare
- sound:' un sound element care este creat folosind playSound sau playSound3D.
Returneaza
Această funcție returnează 3 floats și o valoare boolean:
Primul float este cel a sunetului sample rate, al doilea este tempo-ul suntelui tempo, iar cel de-al treilea este înălțimea pitch sunetului. Boolean care reprezintă dacă sunetul este inversat sau nu.
Exemplu
Exemplu 1: Acest exemplu ar returna la fiecare 5 secunde trei valori float reprezentând rata de eșantionare, tempo-ul, înălțimea și o valoare booleană care reprezintă dacă sunetul este inversat sau nu.
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
Vezi și
- getRadioChannel
- getRadioChannelName
- getSFXStatus
- getSoundBPM
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX3D
- playSFX
- playSound3D
- playSound
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundLooped
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound
Shared