Jump to content

[SOLVED]Problem with getSoundBPM


Enkanet

Recommended Posts

Posted (edited)

SOLUTION: The problem is solved by using getSoundLength and getSoundMetaTags with onClientSoundDownloaded and getSoundBPM should be used with onClientSoundBeat. Thanks to Koeno100.

---------------------------------------------------------------------------------------------------------------------------------------------

Hello everybody! I have a problem and I don't know why this happens..

I'm streaming a sound with an url.

local x,y,z = getElementPosition(getLocalPlayer())

musicA = playSound3D(guiGetText(diskEditA), x,y,z)

but when I try this:

outputChatBox(tostring(getSoundBPM(musicA)))

it returns false. Same goes for getSoundLength. It returns '0'. Can anybody help me please?

EDIT: Also I can not setSoundPaused(musicA, false) after creating the sound. What's wrong with my script?

EDIT2: I'm creating the 3D Sound but only I hear the sound not others.

EDIT: The problem is solved by using getSoundLengts and getSoundMetaTags with onClientSoundDownloaded. Thanks to Koeno100.And getSoundBPM should be used with onClientSoundBeat.

Edited by Guest
YnVnhLx.png

'^ Just a beginner scripter.'

Posted
Are you sure that the sound is successfully being created?

Also, I'm not sure if you saw this, but for the getSoundBPM function:

Note: Using this function requires the resource to have the above minimum version declared in the meta.xml section. e.g.

Yeah sound plays properly and I can pause/play it and yeah I also added that to meta.xml. I don't really know where the problem is.

YnVnhLx.png

'^ Just a beginner scripter.'

Posted

Not all sounds return the information you are asking for. Sound lengths won't work properly on streams as there is no end, its probably returning 0 for that reason.

OwlGaming Community Owner

560x95_FFFFFF_FF9900_000000_000000.png

Posted

Chaos is right, I believe getSoundBPM scans through the entire file - from start to finish(hence the lag when you use this function). And as there is no actual end for streamed files, you can't get the BPM.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

The problem is solved by using getSoundLengts and getSoundMetaTags with onClientSoundDownloaded. Thanks to Koeno100. And getSoundBPM should be used with onClientSoundBeat.

YnVnhLx.png

'^ Just a beginner scripter.'

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...