-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Describe the bug
Playing an audio file that doesn't support 3D will still result in BASS_ERROR_NO3D despite disabling it webaudio:set3DEnabled(0). This is due to the bug where BASS cannot play AAC codec streams in 3D https://github.com/Facepunch/garrysmod-issues/issues/2296. This is a shame because Youtube uses AAC codec streams and thus isn't directly playable with WebAudio. Streamcore fixes this and it isn't at all an issue (read end of expected behavior).
To Reproduce
Paste down the following code in Expression 2
(The audio was fetched directly from Youtube, but I've downloaded it and put it on Dropbox since Youtube expires the raw audio link after a while)
if (first()) {
local Url = "https://dl.dropboxusercontent.com/s/olo98rrd1c3w5t4/videoplayback.weba"
local Audio = webAudio(Url)
Audio:set3DEnabled(0)
Audio:setParent(entity())
Audio:play()
}Then open console and you should see the following error:
[WA]: Error when creating WebAudio receiver with id n, Error [BASS_ERROR_NO3D]
Expected behavior
WebAudio should remove the "3d" flag when calling sound.PlayURL if 3D is not enabled. Currently, WebAudio just sets the sound's position on top of the player to mimic 2D which is weird considering removing the "3d" flag would already accomplish the effect. The volume of the 2D sound would just have to be set to 0 when the client leaves the listening radius. Streamcore does something similar by lowering the volume the farther the client is from the sound.
Desktop (please complete the following information):
- OS: Windows
- Gmod Branch: x86-64