novo Posted December 16, 2012 Share Posted December 16, 2012 Hi all. I'm having troubles with doing a check to know if playSound() worked or didn't. Here you have a wrong example of what I want to do: (When I use the following example, it's always showing me "It works fine", doesn't matter if the 1st playSound worked or not) local mapMusic = playSound("music1.mp3") if not (mapMusic) then local radioMusic = playSound("music2.mp3") else outputChatBox ( "It works fine") end Link to comment
Callum Posted December 16, 2012 Share Posted December 16, 2012 Not entirely sure, but playSound may return a sound element even if the URL is incorrect, or the file is inaccessible. Check your client console (F8) after the playSound has executed, it will show any errors. Link to comment
novo Posted December 16, 2012 Author Share Posted December 16, 2012 Not entirely sure, but playSound may return a sound element even if the URL is incorrect, or the file is inaccessible. Check your client console (F8) after the playSound has executed, it will show any errors. BASS ERROR 0 in PlayStream b3D = false path = music.mp3 Link to comment
csiguusz Posted December 16, 2012 Share Posted December 16, 2012 try: getSoundLength(mapMusic) This will return false if the file/url is invalid. Link to comment
novo Posted December 16, 2012 Author Share Posted December 16, 2012 try: getSoundLength(mapMusic) This will return false if the file/url is invalid. It's returning 0, working and not working. Link to comment
csiguusz Posted December 16, 2012 Share Posted December 16, 2012 Oh, sorry my fault, it will always return 0 if you using an URL Link to comment
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