mp3-split
Split audio (and video) files
Install
Make sure you have ffmpeg installed and added to your path then run:
npm install [-g] mp3-split
If you don't have ffmpeg installed, you can install this package which comes with a bundled ffmpeg, and mp3-split will automatically detect and use it.
npm install [-g] ffmpeg-binaries
CLI
mp3-split comes with a built in CLI tool. Type mp3-split -h
to list all options and see an usage example.
For input you can use either a YouTube link or a local file.
The template file format should be in the following format. For more info, checkout ffmpeg's duration syntax page.
[([hh:]mm:ss[.ms...])] My Music Name
A template file usually looks like this:
[00:00] eli filosov [ p h i l o ] - oneofone_rwrk
[01:30] Swishers [SwuM x bsd.u]
[03:28] sweetbn _ i held you so close i forgot the world
[05:52] emune - Gretchen
[07:52] jhfly - sheets
[10:00] arbour - elusive
[11:30] tomppabeats - will you stay here with me
[12:40] tomppabeats - lonely but not when you hold me
[13:31] Bassti - To All The Ladys In The Place
[15:37] wish you still felt this way [ sophie meiers x 90sFlav ]
[18:04] quickly, quickly - getsomerest/sleepwell
[23:36] charlie toØ human - that "just got home from work" type of beat.
[25:37] jinsang - affection
[27:32] jhfly - girl
Library
You can also use mp3-split as a library. Ex:
let mp3Split = ;let options = input: 'myaudio.mp3' audios: '[01:30] My audio';let split = ;split;
mp3-split emits the following events.
// emitted before splitting a file sectionmp3Split;// emitted after splitting filemp3Split;// emitted when a video is found within the given urlmp3Split;// emitted when the "sections" option is parsed and BEFORE splitting the filemp3Split;
License
Licensed under the incredibly permissive MIT license