Note, this is just a WIP! 🛠️
The WASM Component allows developers to write audio plugins in various languages (demo provided in Rust and JavaScript), compile them to WebAssembly (WASM), and run them across different platforms. The demo showcases a desktop application built with Rust using egui as the host, which supports drag-and-drop functionality for already compiled .wasm files as guest plugins.
2024-07-13.10-00-45.mp4
The WebAssembly Component Model (https://component-model.bytecodealliance.org/) represents a new architecture for program development. WASM significantly enhances computation efficiency in browsers and is supported outside browsers by runtimes like Wasmtime. However, WASM lacks a unified interface, which the WebAssembly Component Model addresses. This model enables the creation of a simple API focused on audio logic, which can be directly compiled to WASM.
For example, in the guest-mul scale module, the developer only needs to write a few lines of code:
https://github.com/wasm-audio/wasm-audio-examples/blob/main/guest-mul/src/lib.rs
ensure you have Rust installed:
https://www.rust-lang.org/tools/install
After installing Rust, you should be able to run the following commands to install the necessary tools:
cargo install cargo-component
Then try run the following commands in the root of the project:
./build.sh
cargo run
this will run the basic examplecargo run -p host-egui
this will run the egui example, you can drop the wasm files inwasm-audio-plugin
folder into the window