Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
    
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!! –  Daniel Magliola Aug 10 '09 at 22:42
add comment

3 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
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 :-( –  Daniel Magliola Aug 12 '09 at 13:23
add comment

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!

share|improve this answer
    
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? –  Daniel Magliola Aug 14 '09 at 13:39
add comment

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.

share|improve this answer
    
+1 ffmpeg can do anything! –  Keck Aug 12 '09 at 18:17
    
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? –  Daniel Magliola Aug 14 '09 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 '09 at 2:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.