Browser and NodeJS Web Assembly audio decoder libraries optimized for
size and performance.
This demo for
wasm-audio-decoders
decodes MPEG and Ogg Opus files into raw PCM entirely client side.
Decoding is accomplished using Web Assembly and Web Workers for high
performance and concurrency. The below libraries are featured in this
demo:
-
ogg-opus-decoder
is used to decode Ogg Opus data.
-
Runs using a Web Assembly build of
libopus.
- Decodes up to 255 discrete channels of audio.
-
Runs in the main thread or a separate thread using the Web Worker
api.
-
ogg-vorbis-decoder
is used to decode Ogg Vorbis data.
-
Runs using a Web Assembly build of
libvorbis.
- Decodes up to 255 discrete channels of audio.
-
Runs in the main thread or a separate thread using the Web Worker
api.
-
flac-decoder
is used to decode FLAC data.
-
Runs using a Web Assembly build of
libflac.
- Decodes up to 8 discrete channels of audio.
-
Runs in the main thread or a separate thread using the Web Worker
api.
-
mpg123-decoder
is used to decode MPEG Layer I/II/III data.
-
Runs using a Web Assembly build of
mpg123.
-
Runs in the main thread or a separate thread using the Web Worker
api.
Checkout the
README
on GitHub for more information.
How to use the demo
-
Select a couple MPEG Layer I/II/III (MP3), Ogg Opus, Ogg Vorbis, or FLAC
files to decode.
-
If you want to download a WAVE file for each file that you decode, check
the "Download Results" box.
-
This option may download a lot of files all at once depending on how
many files and workers are selected.
-
Multichannel Ogg Opus and FLAC files may be downloaded and verified
in a tool that supports multichannel WAVE files such as
Audacity.
-
Select the number of workers you wish to use.
-
This controls how many decoding operations will run in parallel.
-
Usually, the (number of CPU cores - 1) is a good number to use.
-
Selecting too many workers with this demo may crash your
browser.
- Click "Decode" to start decoding.