This is probably a stupid question. I just stumbled on needle and tested it on different devices. It’s absolutely great and would allow for efficient development and potentially deployment.
However for my project I want to use FMOD using custom dsp plugins.
Would there be a way to implement it? Probably the whole engine would have to be integrated somehow using custom ts needle components? But that’s probably not even possible so easily.
I have everything running for unity webgl but this of course is completely different.
Hi J Fuellem, thanks for your question. While there isn’t out‐of‐the‐box support for FMOD (and its custom DSP plugins) in Needle Engine, you can experiment with a workaround by building a custom TypeScript component that wraps FMOD’s WebAssembly (WASM) build (if available).
The idea is to load the FMOD module dynamically, initialize it, and then use its API (including your custom DSP plugin code) within the Needle Engine lifecycle. For example, you might import your FMOD WASM module during start(), initialize banks and your DSP plugins, and, if necessary, update FMOD per frame. A simplified example might look like this:
// File: FMODIntegrationComponent.ts
import { Behaviour } from "@needle-tools/engine";
export class FMODIntegrationComponent extends Behaviour {
async start() {
try {
// Dynamically load your FMOD WASM module.
// Change the path to point to your FMOD build.
const FMOD = await import("path/to/fmod-wasm.js");
// Example pseudocode:
// await FMOD.initialize({
// onLoaded: this.onFMODLoaded.bind(this),
// // Pass additional configuration if necessary.
// });
// Optionally, load FMOD banks or set up your custom DSP plugin:
// await FMOD.loadBank("Master");
// FMOD.registerDSPPlugin(myCustomDSP);
console.log("FMOD successfully initialized", FMOD);
} catch (err) {
console.error("Error initializing FMOD:", err);
}
}
update() {
// If FMOD requires routine updates, call it here.
// Example: FMOD.update();
}
// Callback once FMOD is fully loaded.
onFMODLoaded() {
console.log("FMOD is ready – custom DSP plugins can now be used.");
// Set up further DSP processing or trigger events.
}
}
Keep in mind that integrating FMOD in the browser may have extra challenges such as ensuring your FMOD WASM build works properly under WebGL/WebAudio and that the timing of audio processing (and use of custom DSPs) is in sync with your game loop. Since this integration is nontrivial, you may have to adjust the approach based on the specific FMOD features you need.
If you decide to proceed, be sure to review FMOD’s documentation on using its WASM modules and custom DSP plugins. Let me know if you need any further details or guidance.
1 replies left - Become PRO for more replies. thread_gy1hPil6TSxCpv3JQKLhOR71 Reply to this post directly if you need further help (bottom right button)