Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 729 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 729 Bytes

minimp3-wasm

A demo of compiling minimp3 to WebAssembly without Emscripten.

Usage

import { createDecoder } from './dist/minimp3-wasm.js';

const mp3Data = /* Some Uint8Array */;
const decoder = await createDecoder(mp3Data, './dist/decoder.opt.wasm');

decoder.seek(/*position_in_secounds=*/30);
const results = decoder.decode(/*duration_in_seconds=*/10);
// => { pcm: Int16Array(...), ... }

Building

Prerequisites:

$ make
$ npm install
$ npm run build

The decoder wasm and its bindings will be generated under dist/ directory.