Jump to content

playSound() problem :D


novo

Recommended Posts

Posted

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 
  

Posted

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.

Posted
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 

Posted
try:
getSoundLength(mapMusic) 

This will return false if the file/url is invalid.

It's returning 0, working and not working.

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...