getSoundProperties
Client-side
Server-side
Shared
Pair: setSoundProperties
This function gets the properties of a specific sound.
OOP Syntax Help! I don't understand this!
- Method: sound:getProperties(...)
Syntax
float|false, float, float, bool getSoundProperties ( sound theSound )
Required Arguments
- theSound: A sound element.
Returns
- float|false: sample rate
- float: tempo
- float: pitch
- bool: reversed
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.
Code Examples
client
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 soundlocal 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
Audio Functions
- getRadioChannelName
- getRadioChannel
- getSoundBPM
- getSFXStatus
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLevelData
- getSoundLength
- getSoundMetaTags
- getSoundMaxDistance
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX
- playSFX3D
- playSound
- playSound3D
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundMaxDistance
- setSoundLooped
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound