Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do you join multiple MP3 files into one? "cat" and "mp3wrap" are no good as they produce non standard MP3 files. I know I can use audacity, but when you have 1000's of MP3 files to join into one, it takes too long.

Any suggestions?

share|improve this question

3 Answers

up vote 7 down vote accepted

Use ffmpeg or a similar tool to convert all of your MP3s into a consistent format, e.g.

ffmpeg -i originalA.mp3 -f mp3 -ab 128kb -ar 44100 -ac 2 intermediateA.mp3 ffmpeg -i originalB.mp3 -f mp3 -ab 128kb -ar 44100 -ac 2 intermediateB.mp3

Then, at runtime, concat your files together:

cat intermediateA.mp3 intermediateB.mp3 > output.mp3

Finally, run them through the tool MP3Val to fix any stream errors without forcing a full re-encode:

mp3val output.mp3 -f -nb
(source)

share|improve this answer
So it's not possible to do this lossless? – oshirowanen Oct 24 '10 at 20:05
@oshirowanen maybe using VBR it's possible, did you try that? – Tobias Kienzler Aug 24 '11 at 12:56
interesting, simple catting 2 mp3 files (extracted 2CD movie audio track) automagically works, mplayer shows correct total duration – mykhal Oct 23 '11 at 21:10

You can do this programmatically with ffmpeg's concat demuxer.

First, create a file called inputs.txt with lines like

'/path/to/input1.mp3'
'/path/to/input2.mp3'
'/path/to/input3.mp3'

...etc. Then, run the following ffmpeg command:

ffmpeg -f concat -i inputs.txt -c copy output.mp3

It's possible to generate inputs.txt easily with a bash for loop (this can probably be done with a Windows batch for loop too), assuming you want to merge the files in alphabetical order

for f in ./*.mp3; do echo "'$f'" >> inputs.txt; done
share|improve this answer

Goldwave has some batch processing capabilities, though it's shareware, not freeware.

share|improve this answer

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.