It might well have something to do with the 7.52.2 version since it was commented that it was working with the 7.51.3 version. Although that might not be the case since this example works perfectly well with 7.52.2.
I’ve tried to take that example and simulate it using my setup (with a audioEngine: true) but I just can’t get it to work. In my setup, that example failures while accessing the channels:
testing.1.2.3.testing:292 Uncaught TypeError: Cannot read properties of undefined (reading 'getChannelData')
at createRibbonForNote (testing.1.2.3.testing:292:61)
What exactly does the playground do to get legacy audio to work?
There must be something else other than just audioEngine: true.
For backward compatibility they are enabling the old audio engine in playgrounds that contain BABYLON.Sound, even if the engine’s audioEngine option is set to false like in this playground: https://playground.babylonjs.com/#QARKUZ#5.
PR 16273 should fix the issue. When that PR is merged.
Exactly but when I do that with audioEngine: true in my setup, the old sound does not work. That’s what I can’t get my head around - there is something else - IMHO - going on in the playground to make the “old” audio engine still work.
Is there another external JS lib that needs to be included? Some addon?
Awesome! Thank you. I found the issue and fixed it with PR 16278. The audioEngine: true option should work again when that PR gets merged and released.
If I include that and use audioEngine: true, nothing happens - audio doesn’t work. Removing the recast.js and using audioEngine: true works as expected.
That should work if you’re using the old audio engine.
If you’re trying to unlock the new audio engine the same way, then that won’t work. You’ll have to call unlock on the new audio engine instance returned by CreateAudioEngineAsync.
Ya, you should be able to use the old audio engine exactly the same way it worked before as long as you turn it on with the audioEngine: true option in the graphics engine constructor.