A wasm opus decoder and opus encoder based on eshaz/wasm-audio-decoders's opus decoder.
Each decoder is built with inline WASM to reduce bundling complexity with transpilers like Webpack. The inlined WASM is encoded using yEnc for efficient binary encoding and is gzip compressed for reduced file size.
Decodes raw Opus audio frames into PCM
- 85.4 KiB minified bundle size
- Browser and NodeJS support
- Built in Web Worker support
- Multichannel decoding (up to 255 channels)
- Based on
libopus
Encodes PCM into raw Opus audio frames
- 152.2 KiB minified bundle size
- Browser and NodeJS support
- Built in Web Worker support
- Based on
libopus
- Linux, or a Linux-like environment to build (i.e. WSL).
- NodeJS 18.x or higher.
- Docker for compiling with correct dependencies (recommended)
- Clone this repo.
- Change directory to this repo and run
git submodule update --initto clone the git sub-modules.
git clone https://github.com/MinceraftMC/SonusOpusWasm.git
cd SonusOpusWasm
git submodule update --init- Run
yarn installto install the build dependencies. - Run
yarn run install-codersto install the dependencies for each submodule.
yarn install
yarn run install-codersJust run compile-opus.sh with the BUILD_DOCKER_IMAGE environment variable set to any non-empty value.
BUILD_DOCKER_IMAGE=1 ./compile-opus.sh- Make your changes
- If you updated any dependencies, make sure to install them.
- If you updated any configuration in the
Makefileor changed any of the submodules, make sure toconfigurethe project. - Rebuild the project.
All contributions are welcome! Please keep in mind that this repository is just a fork of eshaz/wasm-audio-decoders.
The source code that originates in this project is licensed under the MIT license. Please note that any external source code included by repository, such as the decoding/encoding libraries included as git submodules and compiled into the dist files, may have different licensing terms.