PT-BR/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| Essa função obtém as propriedades de um elemento de áudio. }} ==Sintaxe== <syntaxhighligh...") |
mNo edit summary |
||
| Line 42: | Line 42: | ||
==Veja também== | ==Veja também== | ||
{{ | {{PT-BR/Funcoes_audio_client}} | ||
[[en:getSoundProperties]] | [[en:getSoundProperties]] | ||
[[hu:getSoundProperties]] | [[hu:getSoundProperties]] | ||
[[ar:getSoundProperties]] | [[ar:getSoundProperties]] | ||
Latest revision as of 00:04, 18 August 2021
Essa função obtém as propriedades de um elemento de áudio.
Sintaxe
float, float, float, bool getSoundProperties( element audio )
Sintaxe POO(OOP) Não entendeu o que significa isso?
- Método: audio:getProperties(...)
- Oposto: setSoundProperties
Argumentos necessários
- audio: um elemento de áudio criado com playSound ou playSound3D.
Retorno
Essa função retorna três floats e um boolean:
- float: representa o valor da amostragem ou bitrate.
- float: representa a velocidade do compasso do áudio.
- float: representa o tom do áudio.
- boolean: representa se o áudio está de tráz para frente ou não.
Exemplo
Esse exemplo retorna os valores de amostragem, compasso, pitch e se o áudio está de tráz para frente a cada cinco segundos.
local audio
local timer
addCommandHandler("propriedades",
function ()
audio = playSound("audio.mp3")
timer = setTimer(function() soundProperties(audio) end, 5000, 0)
end
)
function soundProperties(audio)
local amostragem, compasso, tom, revertido = getSoundProperties(audio) --gets the sample rate, tempo, pitch and a boolean value representing whether the sound is reversed or not.
outputChatBox(amostragem .. " " .. compasso .. " " .. tom .. " " .. tostring(revertido))
end
Veja também
getSoundEffectParameters
getSoundFFTData
getSoundLength
getSoundLevelData
getSoundMaxDistance
getSoundMetaTags
getSoundMinDistance
getSoundPan
getSoundPosition
getSoundProperties
getSoundSpeed
getSoundVolume
getSoundWaveData