Experimental, use in production with caution
Simple way to merge, concatenate, play, export and download audio files with the NodseWeb Audio API.
npm install node-crunker
const NodeCrunker = require('node-crunker');
const audio = new NodeCrunker();
audio
.fetchAudio(
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
)
.then(buffers => audio.mergeAudio(buffers))
.then(merged => audio.export(merged, 'merged.mp3'))
.catch(error => {
console.log(error);
});
audio
.fetchLocalAudio(
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
)
.then(buffers => audio.mergeAudio(buffers))
.then(merged => audio.export(merged, 'merged.mp3'))
.catch(error => {
console.log(error);
});
audio
.fetchAudio(
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
)
.then(buffers => audio.concatAudio(buffers))
.then(merged => audio.export(merged, 'merged.mp3'))
.catch(error => {
console.log(error);
});
audio
.fetchAudio(
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
)
.then(buffers => audio.concatAudio(buffers))
.then(merged => audio.export(merged, 'merged.mp3'))
.catch(error => {
console.log(error);
});
MIT