JSPM

js-mp3

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 37
  • Score
    100M100P100Q58180F
  • License MIT

Pure JS mp3 decoder.

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.
Build Status

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

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.