Web Assembly audio decoders extremely optimized for measurement and efficiency
WASM Audio Decoders is a set of Web Assembly audio decoder libraries which might be extremely optimized for browser use. Each module helps synchronous decoding on the principle thread in addition to asynchronous (threaded) decoding via a inbuilt Web Worker implementation.
Web Assembly is a binary instruction format for a stack-based digital machine that enables for close to native code execution pace inside an internet browser. In follow, these decoders are simply as quick, and in some circumstances sooner, than the browser implementation.
Each decoder is constructed with inline WASM to scale back bundling complexity with transpilers like Webpack. The inlined WASM is encoded utilizing yEnc for environment friendly binary encoding and is gzip compressed for decreased file measurement.
Pre-built minified JS information can be found from NPM and in every decoder’s dist folder.
Decodes MPEG Layer I/II/III into PCM
- 84.6 KiB minified bundle measurement
- Browser and NodeJS help
- Built in Web Worker help
- Based on
mpg123 - Install utilizing NPM
Decodes FLAC and Ogg FLAC information into PCM
- 65.3 KiB minified bundle measurement
- Browser and NodeJS help
- Built in Web Worker help
- Multichannel decoding (as much as 8 channels)
- Supports full FLAC bit depth and pattern price.
- Based on
libFLACandcodec-parser - Install utilizing NPM
Decodes Ogg Opus information into PCM
- 108.9 KiB minified bundle measurement
- Browser and NodeJS help
- Built in Web Worker help
- Multichannel decoding (as much as 255 channels)
- Based on
libopusandcodec-parser - Install utilizing NPM
Decodes uncooked Opus audio frames into PCM
- 85.0 KiB minified bundle measurement
- Browser and NodeJS help
- Built in Web Worker help
- Multichannel decoding (as much as 255 channels)
- Intended for customers that have already got Opus frames extracted from a container, i.e. (Ogg, Matroska (WEBM), or ISOBMFF (mp4))
- Based on
libopus - Install utilizing NPM
Decodes Ogg Vorbis information into PCM
- 97.9 KiB minified bundle measurement
- Browser and NodeJS help
- Built in Web Worker help
- Multichannel decoding (as much as 255 channels)
- Supports full Vorbis pattern price.
- Based on
libvorbisandcodec-parser - Install utilizing NPM
- Linux, or a Linux-like setting to construct (i.e. WSL).
- NodeJS 18.x or greater.
- Emscripten 3.1.51
- Clone this repo.
- Change listing to this repo and run
git submodule replace --initto clone the git sub-modules.
git clone https://github.com/eshaz/wasm-audio-decoders.git
cd wasm-audio-decoders
git submodule replace --init
- Run
npm set upto put in the construct dependencies. - Run
npm run install-decodersto put in the dependencies for every decoder.
npm set up npm run install-decoders
supplythe Emscripten path within the terminal you need construct in.- i.e.
$ supply path_to_your_emscripten_installation/emsdk_env.sh
- i.e.
- Run
npm run configureto configure the libraries. (solely required for first time construct, or after updating theMakefile) - Run
npm run constructto construct the libraries.- The builds might be situated in every library’s
distfolder.
- The builds might be situated in every library’s
# solely required for first time construct, OR after updating the `Makefile` npm run configure # builds the undertaking npm run construct
- Run
npm run take a look atto run the take a look at suite.
- Make your modifications
- If you up to date any dependencies, ensure to set up them.
- If you up to date any configuration within the
Makefile, ensure to configure the undertaking. - Rebuild the undertaking.
- Ensure the assessments nonetheless cross by operating
npm run take a look at.
All contributions are welcome!
- Questions / feedback needs to be entered into a difficulty.
- Changes needs to be entered right into a PR.
- Please learn via the present points to test in case your query / remark has already been addressed, however do not hesitate to succeed in out in case you nonetheless have unanswered questions.
- Please ensure to obviously describe your query / remark, or the function / repair you want to contribute.
- Sharing pattern information as an indication is often one of the simplest ways to do that.
- Adding take a look at circumstances for brand spanking new options or fixes is very appreciated.
All contributes / interactions with this repository should observe the code of conduct.
- Show your help by ‘starring’ this repo, contributing, or donating via Github sponsors.
OggOpusDecoderwas initially primarily based on AnthumChris/opus-stream-decoder.- This model has been optimized for measurement and for easy bundling in net functions:
- Everything is bundled in a single minified Javascript file for ease of use.
- Multichannel decoding (all 255 Opus channels) is supported.
- WASM binary is encoded inline utilizing yEnc binary encoding and compressed utilizing DEFLATE to considerably scale back bundle measurement.
- WASM compiler, minifier, and bundler choices are tuned for absolute best measurement and efficiency.
- This model has been optimized for measurement and for easy bundling in net functions:
puffis included as a WASM construct from madler/zlib and is used to decompress the WASM binary.
The supply code that originates on this undertaking is licensed underneath the MIT license. Please word that any exterior supply code included by repository, such because the decoding libraries included as git submodules and compiled into the dist information, might have completely different licensing phrases.
HI-FI News
by way of Hacker News https://ift.tt/iJZDq35
October 31, 2024 at 01:13PM
-
Product on sale
Audiophile Vinyl Records Cleaning BundleOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Product on sale
Easy Start Vinyl Records Cleaning KitOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Vinyl Records Cleaner Easy Groove Concentrate€34.95 incl. VAT -
Easy Groove Super Set€199.00 incl. VAT -
Easy Groove Enzycaster – vinyl records prewash cleaner€34.95 incl. VAT -
Easy Groove Extreme MK. II- vinyl records prewash cleaner€45.00 incl. VAT -
Vinyl Records Cleaner – Easy Groove Virgin Concentrate€35.00 incl. VAT -
Easy Groove Spray&Wipe vinyl records cleaner€34.95 incl. VAT








