Garry's Mod

Garry's Mod

[E2] WebAudio
72 Comments
niko 24 Jan @ 11:09am 
For some reason, a webAudio object can be created from "https://myinstants.com/media/sounds/taco-bell-bong-sfx.mp3" (whitelisted) but not from "https://trekcore.com/audio/aliensounds/alien_door01.mp3" (also whitelisted). Any idea why? I'm not seeing any errors in console.
kyiscray 5 Jul, 2023 @ 7:18pm 
when i try to make the audio 4d, it errors. even when i tried reinstalling webaudio it wont load sound in 4d :( i was really hoping to make a timed audio channel in a loaded html website hosting a minecraft server yesterday
Vurv  [author] 5 Jul, 2023 @ 6:25pm 
Should be fixed now
[DSTM] Naki 5 Jul, 2023 @ 6:00am 
so what ever you changed broke it
[DSTM] Naki 5 Jul, 2023 @ 6:00am 
alright confirmation, wa is no longer recognized as an extension, it's not on the list anymore, which is why the functions are gone
[DSTM] Naki 4 Jul, 2023 @ 11:09pm 
When i wrote that, all of the functions were gone, not sure about now
Vurv  [author] 4 Jul, 2023 @ 9:21pm 
Wut
[DSTM] Naki 4 Jul, 2023 @ 3:35am 
all functions are gone again
Vurv  [author] 17 Jun, 2023 @ 11:18pm 
Make sure the dropbox link is valid, I know it's annoying to get the proper url
Remmy 17 Jun, 2023 @ 1:08am 
No other links work, aside from discord (If whitelisted).
Remmy 12 Jun, 2023 @ 11:48pm 
Whenever I try playing a dropbox sound, it with returns this in console BASS_ERROR_FILEOPEN
Vurv  [author] 19 Apr, 2023 @ 9:43pm 
What are you even talking about?
Sanders 17 Apr, 2023 @ 8:11pm 
sooo i cant use this for making a radio? then why is this here?
Vurv  [author] 11 Mar, 2023 @ 12:17am 
I unwhitelisted discord because of security reasons (discord blocks steam http headers so there's no way for my security check to work on it.). Tell rubat to add a way to remove that header so we can request discord links.
Nova Astral 9 Mar, 2023 @ 11:19am 
what kind of tests did you do for checking discord, because adding it back to the whitelist (removing the comment) works perfectly fine
Match Grade 23 Feb, 2023 @ 10:25pm 
what is the syntax for the whitelist file?
the file doesn't exist on either my server or client machine
Vurv  [author] 8 Feb, 2023 @ 7:14pm 
Check your console to see if the stream errored. It automatically marks it as invalid if it encounters an error while playing the audio on your client, also an issue on the github would be appreciated (with reproducible code)
G men 8 Feb, 2023 @ 10:34am 
and when they're also in if conditions
G men 8 Feb, 2023 @ 10:32am 
for some reason, the streams don't work for me when they aren't looped
Vurv  [author] 27 Jan, 2023 @ 4:36pm 
You need to elaborate how it "stopped working". Please make a github issue, or join the discord and explain.

The addon hasn't been updated in 5 months, so.
Dremker_Vờyҝ07 26 Jan, 2023 @ 8:31am 
After the latest updates, it stopped working, can you fix it? Writes time out to the console.
Vurv  [author] 24 Nov, 2022 @ 1:56pm 
I'm not entirely sure, prob something to do with if it's mono audio, I know for sure one source that doesn't work with webaudio right now is mattjeanes' ytdl api, which outputs mp3s that don't support 3D mode.
Rezerkity 24 Nov, 2022 @ 3:35am 
Can you give me information on which audio file types function in 3D?
Vurv  [author] 23 Nov, 2022 @ 11:47pm 
That error is because webaudio needs to format the streams in 3D mode in order to use things like setPos, direction, etc, and the given audio format you sent can't be played in 3D mode, unfortunately.

It'd need quite the refactor to allow for creating either 3D or 2D mode webaudios. I didn't want to design it like this in the first place because I knew if I did, people would ask why 3D-only functions weren't working for their 2D-mode streams..
neru 23 Nov, 2022 @ 7:47pm 
I keep getting the BASS_ERROR_NO3D error, any idea as to why that could be?
Vurv  [author] 20 Nov, 2022 @ 6:23pm 
Tried it in game, made a webaudio object with an invalid url which would give BASS_ERROR_FILEFORM, and it recycles the webaudio id so I get more streams to use. Are you on the latest version of webaudio?
Rezerkity 20 Nov, 2022 @ 4:49pm 
Purge doesn't do anything for me online, but I imagine it works in singleplayer. My issue is that once a link errors, such as the constant BASS_ERROR_FILEFORM issues, unless I rejoin the server or the server has a full cleanup, the webaudio remains and takes up a slot, and there's no way to remove it via commands or E2. I'm also unsure of how to deal with the BASS_ERROR_FILEFORM issue, it's always either that, or the whitelist complaining (which is unusual as we use the default whitelist, and I format my links the same as the tutorials on github suggest).
Vurv  [author] 20 Nov, 2022 @ 3:48pm 
They should be automatically clearing themselves if they error, that's odd. If you have control of the server box, you can use `wa_purge`. Note this is only on server since on your client `wa_purge` would only stop them on your client.
Rezerkity 20 Nov, 2022 @ 9:03am 
Is there a way to reset a player's webaudios, such as a command to destroy them all? When I'm using webaudio, and trying to make it work, I get a lot of errors through, well, trial and error. Every time I've hit my limit, I have to rejoin the server to try again due to webaudios being created that never expire.
ɅµЋƵƵ 20 Nov, 2022 @ 2:27am 
If the error is internal then does it have anything to do with dropbox? what urls do you know should always work?
Vurv  [author] 20 Nov, 2022 @ 1:21am 
Not sure, that's an internal error from the BASS library (which is what gmod uses for https://wiki.facepunch.com/gmod/sound.PlayURL) . Make sure your files are valid, pretty sure at least one of those should be valid, although I know some file formats are iffy, especially with 3d mode, which WebAudio needs (see https://github.com/Facepunch/garrysmod-issues/issues/2296) .
ɅµЋƵƵ 20 Nov, 2022 @ 1:14am 
Regarding BASS_ERROR_FILEFORM, what kind of goddamn audio is a valid file form because I have tried OGG, MP3, WAV, all on 44100 Hz, this experience has been nothing but frustrating as I literally cannot tell what in the absolute hell this error means because it's clearly not tied to the file format, and if it is, what sort of ancient unheard of file format does this take???
Xenthys 20 Oct, 2022 @ 11:38am 
@Vurv all up to you, it was more a hint "just so you know" than anything else!

Regarding the security issues, it was both already a concern (hence the access control variables, you don't need to fork it to implement a user whitelist) and initially meant for my own use on a server where people with access were already trusted and privileged. Regarding a domain whitelist, then it was indeed out of scope and untrusted users shouldn't have access either way.

My code has never been ideal indeed, I just published it because why not, provided as-is people can do whatever they want with it, plus I could just add it to my collections and be done with it. I acted more because it had no point to exist anymore, due to way better alternatives now, than because server owners are unable to properly understand and restrict the tools they want to use.

Either way, kudos to you and good luck with the GMod community as a whole.
cap 12 Sep, 2022 @ 11:46am 
thanks bro :steamthumbsup:
Vurv  [author] 11 Sep, 2022 @ 8:26pm 
@Legato you can find an example in here: https://github.com/Vurv78/WebAudio/blob/6f538a63f671a0d7439bc537789865aa46c70f4c/lua/autorun/webaudio.lua#L514

I was thinking of porting the default whitelist to this format as well so it's less confusing, but time will tell if I actually do that.
Vurv  [author] 11 Sep, 2022 @ 8:24pm 
@cap Thought it was already whitelisted, added it now. Next time might want to make a github issue (if you can) so I don't forget
Vurv  [author] 11 Sep, 2022 @ 8:21pm 
@Xenthys I appreciate you taking action against the addon and accepting its issues, sorry for the late response but I'm leaving at least most of the streamcore references in the addon for a while, since some servers are adamant on instead forking the addon to patch in a whitelist (there are still much more issues with the addon than just not having a whitelist)

I also want to apologize if my tone in the readme and on your comments seemed pretty aggressive, but the inaction on such security holes (and general gmod addon creators not wanting to accept their code is not ideal) definitely caused some frustration
Smores 3 Sep, 2022 @ 2:31pm 
Heyo. Could I get an example on the webaudio_whitelist.txt? I tried simply typing in my own webserver in the .txt doc since I store all my MP3s there and It keeps saying it's not whitelisted but the server does have a custom whitelist.
cap 9 Aug, 2022 @ 11:29am 
would you ever consider adding google drive to the whitelist? i'm not sure if it'll integrate properly, but i've filled too many dropbox accounts with audio lmfao
Xenthys 31 May, 2022 @ 4:46pm 
Hello, thank you for making a better E2 extension to stream music and sounds.

In my humble opinion, you can now remove comparisons to the StreamCore from your addon page since it is no longer available: it's been hidden from the Steam Workshop + fully disabled with an update for clients / servers that still happen to be subscribed.

Should you still be frustrated with that former addon, feel free to add me in order to ask any question and obtain all the answers you deserve. Have a nice day!
[DSTM] Naki 29 May, 2022 @ 3:24pm 
just to let you know the extension has no functions currently
Vurv  [author] 22 May, 2022 @ 10:48am 
It should clear automatically, plus wa_purge exists granted that wouldn't affect the serverside count of streams
[DSTM] Naki 22 May, 2022 @ 2:53am 
could you possibly add a feature called "wa_clear_client" which would stop your streams, this would mean one doesn't have to reconnect in case their audio stream is full
Vurv  [author] 14 May, 2022 @ 9:09pm 
Unfortunately not right now as that'd break setTime (and other functions iirc). I've filed an issue: https://github.com/Vurv78/WebAudio/issues/51
jason-m 14 May, 2022 @ 6:23pm 
Is there a way to play Block Streamed Audio? Was using StreamCore to Listen to Radio often (like in Cars) and this is not possible now.

[WA]: URL [ https://mp3.ffh.de/radioffh/hqlivestream.mp3 ] was incompatible for WebAudio; It is block-streamed!
A Holly Brocoli 13 May, 2022 @ 3:22pm 
This comment is awaiting analysis by our automated content check system. It will be temporarily hidden until we verify that it does not contain harmful content (e.g. links to websites that attempt to steal information).
Vurv  [author] 12 May, 2022 @ 9:56pm 
@Mrkykun Could you potentially dm some of the links to me on discord to check? It shouldn't behave differently based on file extension or anything.
Vurv  [author] 12 May, 2022 @ 9:55pm 
@HollyBlocky I believe I've fixed the issue in https://github.com/Vurv78/WebAudio/commit/af9718b2484de6cc501b032e410bae8f3889a289 .

It was because I added a change to make webaudio streams parent to the chip by default on xwa:play() if xwa:setPos() was never called but also should've checked if they xwa:setParent() previously.. either way it's a nice qol feature now and thank you (make an issue tho next time so I don't forget, although someone did it this time: https://github.com/Vurv78/WebAudio/issues/49)
Mrkykun 11 May, 2022 @ 12:15am 
@Vurv i got a shitton of links on disc, all .ogg, and now even though discord is in the whitelist, it still throws an error that it isn't
is it because of the format? Does it have to be mp3?