MP3 Cutter is a JavaScript library and a NodeJS module that allows you to cut your MP3 files by seconds.
const MP3Cutter = require('mp3-cutter');
const sendData = async (req, res) => {
MP3Cutter.cut({
src: 'source.mp3',
responseObj: res,
start: 25,
end: 70
});
}
Path to the file to be cut.
HTTP response object
Start position in seconds.
End position in seconds.
You can also use MP3 Cutter on the command line.
$ npm install -g mp3-cutter
$ mp3-cutter --src source.mp3 --target target.mp3 --start 10 --end 50
MP3 Cutter is provided under the MIT License.