Closed geneotech closed 3 weeks ago
Hello! Do you mean for AL_SOURCE_DISTANCE_MODEL
? I'm afraid the other issues are too complex to be easily reproduced in a simple test.
Hello! Do you mean for
AL_SOURCE_DISTANCE_MODEL
? I'm afraid the other issues are too complex to be easily reproduced in a simple test.
Whatever can be reasonably tested should be yes. Perhaps the first 2 parts of this change at least should be fairly straight forward to test?
In fact, I wonder if we can split out the updateSourceTime
into its own PR, since it seems a little more complex, and worthy of some deeper analysis, whereas the other two fixes look trivial.
For the updateSourceTime
issue in particalar I'd be interested to know which of the assignments to src.bufOffset
causes is used when its is NaN. Are you able to catch it in devtools? Can you see which of the three branches in updateSourceTime
that assigned to bufOutput
were taken?
Thank you! This test to alDisable
/alEnable
/alIsEnabled
should cover it, the panning still seems to work. As for the audiobuf
typo, I'm really not sure how to cover it because the implications of the typo being there are really somewhat complex.
I'll make the separate PR with updateSourceTime only once I find the real cause.
audiobuf
inoffset -= src.bufQueue[src.bufsProcessed].audiobuf.duration;
is misspelled -audioBuf
was likely intended. I found this because I was getting aTypeError: src.bufQueue[src.bufsProcessed] is undefined
, although I'm not 100% sure it was caused by the typo.switch
cases forAL_SOURCE_DISTANCE_MODEL
were checking against the string'AL_SOURCE_DISTANCE_MODEL'
instead of the integer value0x200
, causingAL_INVALID_ENUM
onalIsEnabled
,alEnable
andalDisable
with this enum.updateSourceTime
sometimes leaves the src.bufOffset with aNaN
value, although sadly I'm not sophisticated enough to understand why. I have added a harmless check that just sets it to 0 in case it turnsNaN
, which arguably shouldn't break anything, and it completely fixes the following crash:I have already battle-tested this one
if
clause in my browser game and it seems to work.