HU/getSoundProperties: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 12: | Line 12: | ||
===Visszaadott érték=== | ===Visszaadott érték=== | ||
Ez a fuknció visszaad 3 [[float| | Ez a fuknció visszaad 3 [[float|float]] és egy [[boolean|logikai]] értéket: | ||
The first float is the sound's [http://en.wikipedia.org/wiki/Sampling_rate sample rate], 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. | The first float is the sound's [http://en.wikipedia.org/wiki/Sampling_rate sample rate], 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. |
Revision as of 10:36, 19 July 2018
Ez a funkció egy hang sajátos tulajdonságát adja vissza.
Szintaxis
float, float, float, bool getSoundProperties( element sound )
OOP Syntax Help! I don't understand this!
- Method: sound:getProperties(...)
- Counterpart: setSoundProperties
Kötelező argumentumok
- sound: egy hangelem, amelyet a playSound vagy a playSound3D segítségével hozták létre.
Visszaadott érték
Ez a fuknció visszaad 3 float és egy logikai értéket:
The first float is the sound's sample rate, the second one the sound's tempo, and the third one the pitch of the sound. The boolean representing whether the sound is reversed or not.
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.
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
See Also
- HU/getRadioChannel
- HU/getRadioChannelName
- HU/getSFXStatus
- HU/getSoundBPM
- HU/getSoundEffects
- HU/getSoundFFTData
- HU/getSoundLength
- HU/getSoundLevelData
- HU/getSoundMaxDistance
- HU/getSoundMetaTags
- HU/getSoundMinDistance
- HU/getSoundPan
- HU/getSoundPosition
- HU/getSoundProperties
- HU/getSoundSpeed
- HU/getSoundVolume
- HU/getSoundWaveData
- HU/isSoundPanningEnabled
- HU/isSoundPaused
- HU/playSFX
- HU/playSFX3D
- HU/playSound
- HU/playSound3D
- HU/playSoundFrontEnd
- HU/setRadioChannel
- HU/setSoundEffectEnabled
- HU/setSoundMaxDistance
- HU/setSoundMinDistance
- HU/setSoundPan
- HU/setSoundPanningEnabled
- HU/setSoundPaused
- HU/setSoundPosition
- HU/setSoundProperties
- HU/setSoundSpeed
- HU/setSoundVolume
- HU/stopSound