2

I have about 50x 1 hour long flac files (audiobooks), each of which I need to encode into (approx.) 10 minute long segments at a convenient silence point (+ or - 30 seconds either side of 10 minutes). The last segment can be shorter than 10 minutes (for those flac files which are not exactly an hour).

Grateful for any suggestions of a command line for each flac, which I can then put into a bash script. Thanks.

andrew.46
  • 37,085
  • 25
  • 149
  • 228
abssorb
  • 55
  • 1
  • 7

1 Answers1

1

Just to let you know: If you have cuesheets to those files you can split them by the information provided by the cuesheet file.


I don't know about GUI tools for this job, but I used mp3splt for such a task in the past. You could convert all those files into MP3 or Vorbis (oggsplt) and then feed them to mp3splt.

Here is an example:

$ mp3splt -rS 5 hoaxcast122_versailles.mp3 
mp3splt 2.4.2 (13/05/12) - using libmp3splt 0.7.2
    Matteo Trotta <mtrotta AT users.sourceforge.net>
    Alexandru Munteanu <io_fx AT yahoo.fr>
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
 Processing file 'hoaxcast122_versailles.mp3' ...
 info: file matches the plugin 'mp3 (libmad)'
 info: found Xing or Info header. Switching to frame mode... 
 info: MPEG 1 Layer 3 - 44100 Hz - Mono - FRAME MODE - Total time: 41m.01s
 info: starting 'split in equal tracks' mode
   File "hoaxcast122_versailles_00m_00s__08m_12s_39h.mp3" created           
   File "hoaxcast122_versailles_08m_12s_39h__16m_24s_78h.mp3" created       
   File "hoaxcast122_versailles_16m_24s_78h__24m_37s_17h.mp3" created       
   File "hoaxcast122_versailles_24m_37s_17h__32m_49s_56h.mp3" created       
   File "hoaxcast122_versailles_32m_49s_56h__41m_01s_94h.mp3" created       
 Processed 94247 frames - Sync errors: 0
 split in equal tracks ok

The parameter r stands for trim using silence detection and S stands for split into equal time tracks or better said parts (5 in this case, which would result in 10 minutes per file in your case).

You could create a project folder containing the converted mp3 files and run the following bash script to have all .mp3 files split with the command:

for file in $(ls *.mp3); do mp3splt -rS 5 $file; done

As far as I know the files are not re-encoded, just split and re-wrapped into proper container.

LiveWireBT
  • 28,405
  • 26
  • 107
  • 221
  • I've arrived at the need for sox after trying mp3splt. Unfortunately mp3splt messes up VBR files and introduces pops and clicks when ffwd or rewinding tracks. So I plan to re-rip all the CDs into FLAC. The cue sheets for the CDs follow the tracks on the CD, which is what I'm deliberately trying to get away from. I thought about faking a cue sheet, but I can't find a way to get the cue sheet splits to line up to silences. – abssorb Apr 17 '13 at 00:05
  • By the way, mp3splt -rS 5 is slow as it decodes the files, and the divide by 5 is OK, but not all CDs are the same length. I was using mp3splt -a -p gap=30,th=-18 -f -t 10.00 The -f option is supposed to support VBR, but unfortunately the results were not good. – abssorb Apr 17 '13 at 00:14
  • Yes, the decoding is mentioned in the manpage when usung `r`, though it seems to be doing this only once for a file. Sorry that I couldn't offer you a better solution. – LiveWireBT Apr 17 '13 at 08:39