Garry's Mod

Garry's Mod

39 ratings
[E2] WebAudio
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun, Realism
File Size
Posted
Updated
90.200 KB
24 Apr, 2021 @ 10:55am
2 Sep, 2023 @ 11:27pm
51 Change Notes ( view )

Subscribe to download
[E2] WebAudio

In 1 collection by Vurv
Expressive Alpha Testing
23 items
Description
WebAudio
Wiki[github.com]
This addon adds a serverside WebAudio class which can be used to interact with clientside IGmodAudioChannels asynchronously.
It also adds an extension for Expression2 to interact with these in a safe manner.

This is essentially a safe and more robust replacement for the popular Streamcore addon, since it is much more secure and customizable.

Why use this instead of Streamcore?
Streamcore is a dangerous addon.
It has no whitelist, meaning anyone can force everyone on the server to download ILLEGAL CONTENT or grab everyone's IP Addresses through links like grabify.
Server owners aren't safe either, streamcore easily allows you to crash everyone on it through spamming net messages.

In fact, this addon was made out of frustration over how low effort / terrible streamcore is and how the author does not care about the security of people's games whatsoever after years of reports over these vulnerabilities.

WebAudio easily solves this through a whitelist, active development and flexible but strong limits.

WebAudio has much more features.
Have you ever wanted to pause a stream while it was playing?
Maybe turn up the volume higher because it was too quiet?
Maybe even getting the current playback time or FFT values of the stream?
You can easily do all of this + much more with WebAudio.[github.com]

Features
  • Client and Serverside URL whitelists, both are customizable with simple patterns or more advanced lua patterns.
  • The WebAudio type in Expression 2 that adds the ability to change sounds in a 3D space, or change it's volume, position and time whilst the music is playing.
  • Easy to use Lua api that tries to mirror the IGModAudioChannel type.

I want to contribute!
Then use the Github page! https://github.com/Vurv78/WebAudio
Pull request anything you like, just make sure to see CONTRIBUTING.md

I've found a bug!
You can report bugs by either posting a report on the Github page[github.com], or by starting a new conversation on this page.
Make sure to be detailed and concise in your bug reports, so that they can be serviced easier!

ConVars
This is a list of ConVars that you can change to configure the addon to your liking.
Realm
Name
Default Value
Description
SHARED
wa_enable
1
Shared convar that allows you to disable WebAudio for the server or yourself depending on whether it is executed in the client or server console
SERVER
wa_admin_only
0
Allows you to set WebAudio E2 access to only Admins or Only Super Admins. (0 for Everyone, 1 for Admins, 2 for Super Admins).
SHARED
wa_volume_max
300
Shared convar that allows you to set the maximum volume a WebAudio stream can play at.
100 is 100%, 50 is 50% and so on.
Helps to prevent nasty earrape music being played too loudly
SERVER
wa_stream_max
5
Serverside convar that allows you to set the max amount of streams a player can have at once
SHARED
wa_radius_max
3000
Allows you to set the maximum distance a stream can be heard from. Works on your client.
SHARED
wa_fft_enable
1
Whether FFT data is enabled for the server / your client. You shouldn't need to disable it as it is very lightweight
CLIENT
wa_verbosity
1
Verbosity of console notifications. 2 => URL/Logging + Extra Info, 1 => Only warnings/errors, 0 => Nothing (Avoid this)

Console Commands
This is a list of Concommands to use with this addon as a server owner and a user.

Realm
Name
Description
SHARED
wa_purge
Purges all currently running streams and makes sure you don't get any useless net messages from them.
SHARED
wa_reload_whitelist
Reloads your whitelist at data/webaudio_whitelist.txt
SHARED
wa_list
Prints a list of currently playing WebAudio streams (As long as their owner IsValid) with their url, id & owner
SHARED
wa_help
Prints the link to the github to your console
CLIENT
wa_display
Displays active WebAudio streams to your screen w/ steamid and stream id

Function Docs
Function documentation has moved to only be on Github[github.com].
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).