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 file long.mp3
  • -acodec: use audio codec
  • copy: 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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -