pepsi18 Posted July 11, 2017 Share Posted July 11, 2017 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
Shayan816 Posted July 11, 2017 Share Posted July 11, 2017 (edited) you trying to stream the song ?? if you are trying to stream a radio then use https://wiki.multitheftauto.com/wiki/PlaySound3D Edited July 11, 2017 by Shayan816 Link to comment
pepsi18 Posted July 11, 2017 Author Share Posted July 11, 2017 56 minutes ago, Shayan816 said: you trying to stream the song ?? if you are trying to stream a radio then use https://wiki.multitheftauto.com/wiki/PlaySound3D Only a background sound that lasts 2 minutes But it only reproduces me 20 seconds then it cuts Link to comment
Shayan816 Posted July 11, 2017 Share Posted July 11, 2017 maybe there is setTimer function in the script.. check your script Link to comment
pepsi18 Posted July 11, 2017 Author Share Posted July 11, 2017 When I play a .wav file plays full But is cut off from time to time Link to comment
Discord Moderators Pirulax Posted July 11, 2017 Discord Moderators Share Posted July 11, 2017 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
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