3

I'm looking for a way to take a 1-hour podcast MP3 file and split it into several several 2-minute MP3s. Along the way, I'd like to also do a few things like Amplify the volume.

The problem I'm solving is that I have a crappy MP3 player that won't let me seek forward or backward, nor will it remember where I left it when I turn it off, plus, I listen to these in a seriously high-noise situation. Thus, I need to be able to skip forward in large chunks (2-5 minutes) to the point where I left it.

Is there any decent way to do this?

Audacity doesn't seem to have command-line capabilities.

I'm willing to write some code, for example, to call something over the command line and get how long the MP3 file is, to later know how many pieces i'll have, and then say "create an MP3 with 0:00 to 2:00", "create an MP3 with 2:00 to 4:00", etc.

I'm also willing to pay for the right tools if necessary.

I also don't care how slow this runs, as long as I can automate it :-)

I'm doing this on Windows.

Any pointers / ideas?

Thanks!

1
  • I'd also love to automate the amplifying, if it's possible, although, the splitting part is definitely the biggest. Doesn't have to be the same tool for everything, of course :-) Thanks!! Aug 10, 2009 at 22:42

4 Answers 4

1

Mp3Split would do the trick for splitting the files.

The LAME mp3 encoder has an option, --scale, that I believe can be used to increase the volume of the PCM values as well by a certain factor. To determine the gain value for use with LAME, you can use the mp3gain (windows only) tool which should give you a sufficiently higher volume level, without any clipping or level-induced distortion on the part of the file. I'm certain there are also *nix tools (like wavegain, I think) if your'e running Linux that do the same thing if you search a bit more.

Note, though, that if you work in a very noisy environment (eg. 4 kids + a dog and a hard of hearing mother that all tend to yell/bark/scream at the same time), even that may not be enough. I got some nice headphones / earbuds to eliminate that problem.

1
  • Excellent, i'll look into this, thank you! I'm not worried about clipping, in fact, I'm saturating the sound as much as possible without making it impossible to understand. I don't need good quality, just to make voices understandable. Good headphones are not an option, sadly :-( Aug 12, 2009 at 13:23
2

I think ffmpeg can do what you want:

ffmpeg -i source.mp3 -acodec libmp3lame -ab 128k -t 120 -ss 240 output.mp3
  • The "t" parameter is the duration of the output file (in the sample, 120s = 2min)
  • The "ss" parameter is how much you want to skip from the beginning (in the sample, 240s = 4min)

You can also add the "-vol" parameter to increase the volume.

2
  • That sounds excellent, thanks! Now, to use this, i'd have to call ffmpeg repeatedly, once per each fragment. Do you know how I can get the total MP3 length programatically, so that I can know how many times to loop? Aug 14, 2009 at 13:39
  • If you just call "ffmpeg -i source.mp3" it'll print the file information and exit. This of course includes the duration, so you can just run this command first and parse the output.
    – Badaro
    Aug 15, 2009 at 2:56
1

Try ffmpeg. It's a ridiculously powerful commandline tool that'd be great for this.

Split the mp3 using the short guide here and add the -vol switch to adjust volume.

For more info on ffmpeg switches, go to this guide and check out the FFmpeg homepage. A massive chunk of the commercial, freeware, and opensource audio/visual tools use ffmpeg under the hood for all of their transcoding and av work, give it a shot!

1
  • That sounds excellent, thanks! Now, to use this, i'd have to call ffmpeg repeatedly, once per each fragment. Do you know how I can get the total MP3 length programatically, so that I can know how many times to loop? Aug 14, 2009 at 13:39
0

Check this. I had the same problem with long podcasts and players without display interface, so I wrote a simple bash script to split the podcasts and even add a speech indication of which part are you hearing at the beginning of each track. This feature uses the Text To Speech from Google. The script is prepared for Spanish speakers, but it is trivial to change it for other languages (option -l in the call to Google Speech API)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .