Compatible with Tone.js or raw Web Audio?

Hello, I’m new to babylon.js and have been reviewing its audio capabilities. I see that libraries like https://tonejs.github.io/ are also based on Web Audio and have extensive “DAW”-like capabilities that I think could work great in games.

My question is how one might integrate a Web Audio library like Tone.js with Babylon. For example, if I could define a chain of filters in Tone.js and then get the final Web Audio node, could I pass that into Babylon to link it to a mesh?

Thank you and sorry if the question isn’t very articulate. Still working on Web Audio vocabulary :slight_smile:

1 Like

Hello and welcome!

Here is the initial example of Tone.js integration - Babylon.js Playground
Then one needs to connect Tone.context somehow with AudioEngine | Babylon.js Documentation and play Sound | Babylon.js Documentation

2 Likes

You can just specify the framework’s context to be used by tone.js, according to the link

Tone.setContext(BABYLON.Engine.audioEngine.audioContext)
3 Likes