Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 7 8 9 10 11 … 18 Next »
sounds.playURL()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
sounds.playURL()
11-04-2017, 08:39 AM,
#1
theamazing Offline
Valued donator
****
Posts: 23
Threads: 10
Joined: Mar 2016
sounds.playURL()
Hi,
Yesterday, тѕсм.The17thDoctor, Blackhawk and I tried using the
sound.playURL()
function, but we couldn't find out how. The documentation doesn't help that much about it as well. Could someone explain how it works?
Find
Reply
11-04-2017, 09:19 AM,
#2
jean730 Offline
TSCM Member
***
Posts: 16
Threads: 8
Joined: Dec 2014
RE: sounds.playURL()
I tried it, but even with the instructions on the gmod wiki here, it doesnt work.
(I registered the PLAY_URL_SOUNDS)
I also put a print function in the callback but it didnt print in the chat.
Find
Reply
11-04-2017, 03:30 PM,
#3
Kosmos Offline
GMod Admin
Posts: 180
Threads: 3
Joined: Dec 2013
RE: sounds.playURL()
Code:
sound.playURL(url, "", function(channel, errCode, errMsg))
Which is basically what the documentation tells you, it's the same as playFile, and I haven't had it fail on me so far.
Do note, that GMod waits quite some time before it considers a request timed out or failed (depending on what happened) so if the handler does not get called you most likely gave it the wrong URL in the first place.
It would indeed be very helpful of you if you could provide more details on how you used the function than simply
Code:
sound.playURL()
Find
Reply
11-04-2017, 03:45 PM, (This post was last modified: 11-04-2017, 03:52 PM by jean730.)
#4
jean730 Offline
TSCM Member
***
Posts: 16
Threads: 8
Joined: Dec 2014
RE: sounds.playURL()
Code:
if CLIENT then permissions.register("PLAY_URL_SOUNDS") sounds.playURL("http://jean.langmatt.com/stargate.mp3", "3d", function(music, a, b) _G.print(a) _G.print(b) if music:isValid() then music:play() end end) end

I love cookies Heart !
Find
Reply
11-04-2017, 04:16 PM,
#5
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: sounds.playURL()
Make sure you've granted the chip the right to play sounds from the internet (the shield icon at the top right of the editor). It's not enabled by default.
Find
Reply
11-04-2017, 04:34 PM,
#6
jean730 Offline
TSCM Member
***
Posts: 16
Threads: 8
Joined: Dec 2014
RE: sounds.playURL()
ok thanks

I love cookies Heart !
Find
Reply
11-04-2017, 11:54 PM,
#7
Red The Blue Color Offline
TSCM Super Donating Member
****
Posts: 422
Threads: 34
Joined: Feb 2015
RE: sounds.playURL()
(11-04-2017, 03:45 PM)jean730 Wrote:
Code:
if CLIENT then permissions.register("PLAY_URL_SOUNDS") sounds.playURL("http://jean.langmatt.com/stargate.mp3", "3d", function(music, a, b) _G.print(a) _G.print(b) if music:isValid() then music:play() end end) end

Incase you are still doing that, you don't need to run music:player() the sound will start playing once its ready. i also recommend using
permissions.canPerformAction(permissions.PLAY_URL_SOUNDS)
before even attempting to play any sounds

"with it's superior software, i have no doubt it will succeed in finding fuck all" - T-17, 2016

[Super Member] [ENCOM] т-ѕсм.Red The Blue Color™: server do you support Hitler?
[Server] srcds_linux: The probabilty is about 99.99%, so interpret that how you want to.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.