GetSoundBPM

From Multi Theft Auto: Wiki
Revision as of 17:49, 1 October 2012 by Zver-CR (talk | contribs) (→‎Example)
Jump to navigation Jump to search

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
local sound = playSound ( "http://radio02-cn03.akadostream.ru:8114/nrj192.mp3" )

addEventHandler ( "onClientRender", root,
	function ( )
		local bpm = getSoundBPM ( sound )
		outputChatBox ( string.format ( "BPM: %i", bpm or 0 ) )
	end
)

Requirements

This template will be deleted.

See Also