Source for N-API implemented bindings of Web Audio found

I know the title is a statement, not a question. This repo, GitHub - node-3d/webaudio-raub: Node.js bindings to LabSound's Web Audio Api implementation, is making bindings to Web Audio in a seemingly an exact way needed to be used to hook into Babylon Native.

I never even built enough of this myself (you need a lot since WebAudio has a highly hierarchical class structure), much less got it to compile.

I wonder if someone, actually working on Native, might look at this, and kind of sketch out what they think might be necessary to actually get this into the Native code base. I do not really like @-ing people. You know who you are.

2 Likes

Let s check with @bghgary but I remember @Drigax started some napi bindings with a LIB, just can not remember which lib it was.

Wow, this seems super useful, this seems to handle:

  1. providing a JS surface for the webaudio API in an environment that doesn’t provide it for you (pretty much any JS environment that’s not a web browser)

  2. implements all the NAPI glue code for connecting the JS class declarations to the LabSound components that need to be connected, pretty much all the stuff I attempted to scaffold via Sound Implementation by Drigax · Pull Request #794 · BabylonJS/BabylonNative · GitHub but packaged in a much more modular form.

I’d assume if we wanted to use this in Native we’d create a plugin that would initialize all the napi bindings defined here somehow…

The build system seems interesting, however. I assume that all of this is written for use as Node3D modules, rather than standalone libs. That definitely will complicate things.

I don’t think there’s any other plans to consume node3d modules in BabylonNative…

At the least if theres some solution to taking all this boilerplate and getting it to build as a standalone library we can consume in Native, it seems like most of the other C++ stuff regarding Napi->LabSound interaction seems mostly solved already here, though this is just a cursory glance hehe.

I’m sure @bghgary would be interested in seeing (and possibly evaluating) such a solution. I don’t think Node3D was ever considered as a solution for BabylonNative…

5 Likes

Thanks a ton @Drigax !!!

This is interesting. Definitely worth checking out. I’ve added it to the issue.

2 Likes