Sample Code for using FMOD from JS

Hi!
I was just wondering if there is any sample code for using FMOD from JS. The full story is I’m using FMOD from my Rust project and its great… Now I’m trying to port said project to the web and FMOD is the last question. Now from what I understand FMOD C library ports to web using Emscripten, and after some cursory reading it seems to be not super well supported for Rust. Though trying to use that as the backend and integrating it may be one soluton…
However it seems like I could probably divide and conquer this task if its possible to just get FMOD working from JS and then WASM bindgen the rest for my purposes.

So the subset of functionality im using is

  • playing events from bank
  • stop bus
  • stop all sounds playing on bus
  • set vca
  • set param

So given that, should this work in principle and if so is there any sample code available I could refer to? I’m not the best at JS and have been beating my head against the wall with ChatGPT so far lol!
Thanks so much!

Hi,

Thank you for sharing the information.

That sounds like it will work in principle to me, and we do have some JS examples in the FMOD Engine - HTML5 download on our downloads page, where you can check sample code there.

For more information, you could also have a look at a similar post here:

Hope this helps, let me know if you have any questions.