HU/getSoundLevelData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Remove obsolete Requirements section)
 
(4 intermediate revisions by 2 users not shown)
Line 31: Line 31:
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
==Requirements==
{{Requirements|n/a|1.3.0-9.04162|}}


==Changelog==
==Changelog==
Line 44: Line 41:
[[en:getSoundLevelData]]
[[en:getSoundLevelData]]
[[ar:getSoundLevelData]]
[[ar:getSoundLevelData]]
[[pt-br:getSoundLevelData]]


==Fordította==
==Fordította==
* '''''Surge'''''
'''2018.07.11.''' <font size="3">'''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]'''''</font>

Latest revision as of 17:14, 7 November 2024

This function gets the left/right level from a sound element. Ha az elem egy játékos, akkor ez a funkció a játékos hangját fogja használni.

Szintaxis

int, int getSoundLevelData ( element theSound )

OOP Syntax Help! I don't understand this!

Method: sound:getLevelData(...)


Kötelező Argumentumok

  • theSound: the sound element which level data you want to return.

RVisszaadott érték

Visszaad két egész számot 0 és 32767 között.

Példa

Click to collapse [-]
Client
soundHandler = playSound ( "sound.wav" )

function onSoundPlayRender ( )
    if ( soundHandler ) then
        local leftData, rightData = getSoundLevelData ( soundHandler )
	if ( leftData ) then
            dxDrawRectangle ( 0, 0, 64, leftData / 32767 * 256, tocolor ( 255, 0, 0 ) )
            dxDrawRectangle ( 64, 0, 64, rightData / 32767 * 256, tocolor ( 0, 0, 255 ) )
        end
    end
end
addEventHandler ( "onClientRender", getRootElement(), onSoundPlayRender )

Changelog

Version Description
1.3.2 Added player element to use a players voice

Lásd még

Fordította

2018.07.11. Surge