Enkanet Posted July 2, 2015 Posted July 2, 2015 (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 October 9, 2015 by Guest '^ Just a beginner scripter.'
xXMADEXx Posted July 2, 2015 Posted July 2, 2015 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. The Ultimate Lua Tutorial! | MTA PHP SDK
Enkanet Posted July 2, 2015 Author Posted July 2, 2015 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. '^ Just a beginner scripter.'
ChaosMTA Posted July 7, 2015 Posted July 7, 2015 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
Dealman Posted July 7, 2015 Posted July 7, 2015 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.
Enkanet Posted July 8, 2015 Author Posted July 8, 2015 Okay, thank you all. '^ Just a beginner scripter.'
Enkanet Posted July 10, 2015 Author Posted July 10, 2015 The problem is solved by using getSoundLengts and getSoundMetaTags with onClientSoundDownloaded. Thanks to Koeno100. And getSoundBPM should be used with onClientSoundBeat. '^ Just a beginner scripter.'
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now