I use urho3d to make my H5 game and write it directly in C + +.
I used phaser3 before. It is a JS game framework. I will load the wasm library provided by Fmod through JS and work well.
Now I write my H5 game in C + +, and I try to connect directly to the static library provided by Fmod (Fmod. A|fmod_bindings. A|fmodstudio. A|fmodstudio_bindings. A, etc.)
You can compile directly through EMCC or emcmake. But when running, my browser console will report an error.
I didn’t find a detailed way to use the static library provided by Fmod in H5. I think we should be able to call the method of Fmod directly through C + +, or we must write the JS part, call JS through C + +, and then JS calls the wasm of Fmod.
Thank you very much for asking for a tutorial.
We have some information in the docs about additional requirements for compiling a C/C++ FMOD application into html5 using Emscripten.
To compile an application that uses FMOD, you need to compile your application with the fmod_bindings.a, fmod_js.a and fmod.wasm libraries found in the “upstream/w32” directory.
Here is an example emscripten compilation command:
emcc main.c fmod_bindings.a fmod_wasm.a fmod_js.a -o index.html -s EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap','setValue','getValue']