Facepunch / garrysmod-issues

Garry's Mod issue tracker
141 stars 56 forks source link

BASS Unknown error with some sounds with 3d option #1752

Open thegrb93 opened 9 years ago

thegrb93 commented 9 years ago
] lua_run_cl sound.PlayFile("sound/ambient/forest_day.wav", "", function(...) print(...) end)
IGModAudioChannel [sound/ambient/forest_day.wav]
] lua_run_cl sound.PlayFile("sound/ambient/forest_day.wav", "3d", function(...) print(...) end)
nil -1  BASS_ERROR_UNKNOWN
neico commented 9 years ago

So it's not my fault that I see that for many clients :/

It isn't consistent for me though, sometimes it works, sometimes it doesn't (I'm using a audio stream instead of a file, so I thought it had to do something with the connection :/)

Maybe I should try it with non-3D to see if it's really because of that on my end...

Grocel commented 9 years ago

The problem is that BASS doesn't like auto looping *.wav sounds, if you try non looping ones they will work fine. I think it has something to do with the cues inside them. If you open them with a wav editor, you will see them.

thegrb93 commented 9 years ago

But I'm not using looping at all in the code I posted. Are you saying that looping wavs don't work with non-looping sound plays?

robotboy655 commented 9 years ago

sound/ambient/forest_day.wav IS a looping sound file, it contains markers for looping:

(notice the M0 and M1) image

The problem might be that it uses markers instead of loop points.

Grocel commented 9 years ago

There was an update of BASS where they changed something about *.wav files, along with other fixes. Maybe updating to the new version helps with this issue.

DBotThePony commented 9 years ago

Same here. No loops or something. sound.PlayFile from "data" without "3d" flag is successfully. When adding flag "3d" sound doesn't play. Playing same file in sound.PlayURL with flag "3d" works perfectly.

ghost commented 9 years ago

Gabe Newell will be proud!

Grocel commented 8 years ago

The issue seems to be still present, but a bit changed. For self looping *.wav files it will always return error code 2, even without the "3d" flag.

Grocel commented 6 years ago

According to the change log of BASS the newest version fixes those problems with cues in the sound file. (https://github.com/Facepunch/garrysmod-requests/issues/1071)

Kefta commented 6 years ago

Was this fixed? The original file plays fine on my client now.

Kefta commented 6 years ago

I lied, it seems to still be failing but in a different way. It now prints nil 0 BASS_OK which is from failing to create the mixer channel internally.

WilliamVenner commented 4 years ago

Seems to work for me

sound.PlayFile("sound/npc/turret_floor/ping.wav", "3d noblock noplay", function(chan)
    chan:EnableLooping(true)
    chan:SetPos(self:GetPos())
    chan:Play()
    self.bruh = chan
end)

x86-64, 64-bit gmod

3D fade works too

FlorianLeChat commented 3 years ago

I'm not sure if it's related to yesterday's new update but with Billy's example, the sound seems to repeat for a minute but then stops.. however using the EmitSound* functions it repeats indefinitely like normally. I'm dumb.

robotboy655 commented 3 years ago

Nothing about BASS was changed.

If you mean @WilliamVenner s example, you need to keep a reference to the object for it to play infinitely, as mentioned in the example on the wiki: https://wiki.facepunch.com/gmod/sound.PlayURL You can't just comment out self.bruh = chan

(Also that sound is the most obnoxious thing ever for testing)