javascript - Splitting an audio MP3 file -
i split song using nodejs. have been looking module can process audio files, couldn't find purpose. how can split mp3 file using nodejs?
you use ffmpeg. command line based, great since accessible, subprocesses can die. here node interface abstracts ffmpeg usage out of command line calls: https://npmjs.org/package/ffmpeg
your final commands, in command line this:
ffmpeg -i long.mp3 -acodec copy -ss 00:00:00 -t 00:30:00 half1.mp3 ffmpeg -i long.mp3 -acodec copy -ss 00:30:00 -t 00:60:00 half2.mp3
this command states:
-i
: input filelong.mp3
-acodec
: use audio codeccopy
: making copy-ss
: start time-t
: length- and output file name
to handle potentially timeouts/hung processes should 'retry' , supply timeouts. not sure how error callbacks work. fail appropriately on process hangs.
Comments
Post a Comment