GetSoundBPM: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Spams the chatbox - Undo revision 33668 by Zver-CR (talk))
Line 17: Line 17:
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local sound = playSound ( "http://radio02-cn03.akadostream.ru:8114/nrj192.mp3" )
-- not done yet
 
addEventHandler ( "onClientRender", root,
function ( )
local bpm = getSoundBPM ( sound )
outputChatBox ( string.format ( "BPM: %i", bpm or 0 ) )
end
)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Revision as of 08:55, 3 October 2012

ADDED/UPDATED IN VERSION 1.3.0 r4145:

This function gets the beats per minute of a specific sound element.

Syntax

int getSoundBPM( element sound )

Required Arguments

Returns

Returns the beats per minute of the given sound.

Example

Click to collapse [-]
Client
-- not done yet

Requirements

Minimum server version n/a
Minimum client version 1.3.0-9.04162

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.0-9.04162" />

See Also