GetSoundLevelData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
(Replaced content with "'''Hacked By Ameir''' ''add me on'' [http://facebook.com/AhmedAlramSisYy facebook]")
Tags: Replaced Reverted
Line 1: Line 1:
__NOTOC__
'''Hacked By Ameir'''
{{Client function}}
''add me on''
This function gets the left/right level from a [[sound]] [[element]].
[http://facebook.com/AhmedAlramSisYy facebook]
{{New feature/item|3.0132|1.3.2||
If the element is a player, this function will use the players voice.
}}
==Syntax==
<syntaxhighlight lang="lua">int, int getSoundLevelData ( element theSound )</syntaxhighlight>
{{OOP||[[sound]]:getLevelData}}
===Required Arguments===
*'''theSound:''' the [[sound]] [[element]] which level data you want to return.
 
===Returns===
Returns a two ''integers'' in range from 0 to 32768.
 
==Example==
<syntaxhighlight lang="lua">
local soundHandler = playSound ( "sound.wav" )
 
function onSoundPlayRender ( )
    if ( soundHandler ) then
        local leftData, rightData = getSoundLevelData ( soundHandler )
if ( leftData ) then
            dxDrawRectangle ( 0, 0, 64, leftData / 32768 * 256, tocolor ( 255, 0, 0 ) )
            dxDrawRectangle ( 64, 0, 64, rightData / 32768 * 256, tocolor ( 0, 0, 255 ) )
        end
    end
end
addEventHandler ( "onClientRender", root, onSoundPlayRender )
</syntaxhighlight>
 
==Requirements==
{{Requirements|n/a|1.3.0-9.04162|}}
 
==Changelog==
{{ChangelogHeader}}
{{ChangelogItem|1.3.2|Added player element to use a players voice}}
 
==See Also==
{{Client_audio_functions}}
 
[[hu:getSoundLevelData]]
[[ar:getSoundLevelData]]
[[ro:getSoundLevelData]]
[[pt-br:getSoundLevelData]]

Revision as of 16:31, 26 September 2021

Hacked By Ameir add me on facebook