Jump to content

Help Play Sound Url


pepsi18

Recommended Posts

I have a problem , only played 20 seconds of audio, But the audio takes 2 minutes

form the browser plays full 

function sound()
   playSound("http://216.172.184.135:21/fastdl/soundtracks/soundtrack1.mp3")
 end
 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), sound)

 

Link to comment
  • Discord Moderators
function onClientResStart()
  local file = downloadFile("http://216.172.184.135:21/fastdl/soundtracks/soundtrack1.mp3")
end

addEventHandler("onClientResourceStart",resourceRoot,onClientResStart)

function loool(filename,succ)
  if succ and filename == "soundtrack1.mp3" then
    playSound(filename)
  else
    outputChatbox("Downloading of " .. filename .. " failed!"
  end
end


addEventHandler("onClientFileDownloadComplete", resourceRoot,loool)

should work.

Link to comment

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