MP3 decoder for various build targets. Build targets include at the moment Linux/x64 and WebAssembly.
- Node.js
- Consider installing via nvm
- CMake
- GCC
- For Linux building
- Emscripten
- For WebAssembly building, tested with version 3.1.6
pip install gcovr
npm i
Build WebAssembly target
npm run wasm-build
Execute in Node
npm run decode -- --input=<input.mp3> --output=<output.pcm>
Build target
npm run x64-build
Decode using command line binary
build/bin/mp3streamapp -stream <input.mp3> -out <output.wav> -wave-out
Run unit tests with memory checking enabled and generate code coverage report
npm run x64-build -- --type=Debug --folder=build-debug
npm run x64-tests -- --folder=build-debug --memcheck
npm run x64-coverage -- --folder=build-debug
-
Run in Debug mode
-
Add following line (example only) to
build-wasm/bin/mp3dec_static.html
Module.onRuntimeInitialized=function() {console.log(Module); console.log(Module._openDecoder());}
-
Serve content using
npm run serve-build
-
Goto http://localhost:4200/mp3dec_static.html on browser
-
npm run js-beautify -- build-wasm/bin/mp3dec_static.js -r (unminify js file)
-
node main.js --input=.mp3 --output=test.raw (decode)
-
ffplay -f s16le -ar 44k -ac 2 test.raw (play with ffplay)