Package Exports
- js-mp3
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js-mp3) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
js-mp3
Pure javascript mp3 decoder, translate from go-mp3 project.
Usage
let Mp3 = require('js-mp3');
var mp3ArrayBuffer = ...; // prepare your mp3 decoded array buffer here
var decoder = Mp3.newDecoder(mp3ArrayBuffer);
var pcmArrayBuffer = decoder.decode(); // now you got decoded PCM data
you can visit js-mp3-example project to see how to decode mp3 file then play it.
Tests
Frameworks
rewire
: https://github.com/jhnns/rewireMocha
: https://mochajs.org/Chai
: https://github.com/chaijs/chaiIstanbul
: https://github.com/gotwarlost/istanbul
Run tests with:
$ npm test
Get coverage report:
$ npm run coverage
Then you can find the report html here: {project_location}/coverage/lcov-report/index.html
.
Issue
It put all decoded pcm data in ArrayBuffer now, so you'd better not use it to decode big size MP3 file.