rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.88k stars 160 forks source link

Intigrate Wad with BabylonJS #111

Closed frastlin closed 3 years ago

frastlin commented 5 years ago

Hello, I would love to see integration with Babylon JS, similar to how there is integration with A-Frame. Currently Babylon JS has very limited abstraction from the raw Web Audio API, and Web-Audio-DAW would be a perfect fit with their system. Here is the audio docs Here is the API for Sounds and API for sound tracks

I created an feature request and they are open to PRs. The main objective at this point is to make Babylon as tree-shaker friendly as possible, so although making Wad the default sound engine for the entire Babylon project would be exactly what I'm looking for, I'm not sure if there is a way to remove Wad code during tree-shaking if someone is just using .play(). Wad is hands down the best wrapper of the Web Audio API, and Babylon is probably the most robust and feature rich VR, AR, and 3D library out there, but their audio wrapping is minimal. They Just created audio sprites And it looks like sound tracks are planned to be similar to Polywads.

I personally need the high pass filters, oscillators, env, and pitch change for what I am wanting to use Babylon for.

rserota commented 4 years ago

It would definitely be great if Wad was the default sound engine for Babylon. I don't know much about Babylon, so I'm not sure how much effort would be involved in that. Have you looked through the source code for Babylon?

frastlin commented 4 years ago

It's all in typescript, so I have a hard time reading it. But yes, everything is very modular, and they have a particular section that has the audio settings here. The best option is probably to hook Wad up to match the existing API, and allow extra features that Wad Provides as well. For example, to do a new sound, one could either do their current arguments, or just pass a single object that could be passed to Wad.