This is a js library used to cut mp3 easily.
Feel free to contribute!
Minified version has been compiled using uglifyjs
to minify the doc, do:
uglifyjs -e -o src/cutter.min.js src/cutter.js
let cutter = new mp3cutter(libPath, debug);
libPath
is optionnal, default path is ./lib
debug
is optionnal. It print debug log. Default value is false.
cutter.cut(blob, start, end, callback, bitrate);
blob
is the audio blob.
start
Start time in second.
end
End time in second.
callback
callback function (it is not possible to return data from async)
bitrate
is optionnal, default is 192
That's it !
This library is heavily inspired by audio-cutter
The encoder used is mp3-lame-encoder-js
Here is a more concrete example on how to use this library
function getMyMp3Cut(blob) {
let cutter = new mp3cutter();
cutter.cut(blob, 0, 30, function(cuttedBlob) {
console.log("My blob has been cutted! ");
console.log(cuttedBlob);
});
}