Fog Creek Software
Discussion Board

How does one join MP3 files?

Is there any software that can join several MP3 files into one MP3 file, without having to decode and encode again?

On the web, people advise to just concatenate the files, with commands such as:

copy /B source1.mp3 +source2.mp3 destination.mp3

They say this works, but it makes me wonder: perhaps the MP3 file has a header... when appending the source2.mp3 file, what happens? I add an MP3 header in the middle?

Also, what about the ID3 v1 tag at the end of the file?

So - is there any editor to solve this problem?

Thursday, November 13, 2003

"On the web, people advise to just concatenate the files"

"They say this works, but it makes me wonder..."

So did you actually _try_ it?  Couldn't take more than a minute or two to see whether it works or not, instead of doing inconclusive thought experiments.

Thursday, November 13, 2003

I've wondered this too. It's a legitimate question because - if there *were* such a thing as a file header and you concatenated files in this manner, some MP3 players may work around the multiple headers and play it, and others may not.

Not an authoritative answer but probably OK for a casual inquiry:

So it appears that an MP3 file itself has no file level header as such. Apparently Mp3 was designed to be streamable.

Bored Bystander
Thursday, November 13, 2003

I have been reading about ID3 tags recently. It appears the ID3 v1.x tags are the last 128 bytes of the file and ID3 v2 tags are at the beginning of the file and can be variable in length (usually a file can have both). Taking a little time, it would be quite easy to strip these out and then concatenate the files with a little bit of programming. I would imagine the player would otherwise just interpret the ID3 as music if encountered in the middle of a file.

Thursday, November 13, 2003

MP3 files are made up of several blocks, each of which has its own header.  There is no MP3 header for the whole file.  It was designed with streaming in mind so you can pick up in the middle of the stream and not have to worry about having missed the header.

I think that a proper player would just skip over the ID3 tags, because they wouldn't be recognized as a legitimate block, but you'd have to try it to be sure.

One-Armed Bandit
Thursday, November 13, 2003

MP3 files consists of frames that all have their own header. So, you can just concatenate them. Almost all readers will automatically skip over meta-data (like ID3 tags) while playing the music. When they look for meta-data, though, they might be confused if they do not find it in the beginning (for most ID3v2) or in the end (for all ID3v1).

Francis Van Aeken
Thursday, November 13, 2003

I use a small utility called Id3Remover to remove all v1 and v2 tags from my files.

You could remove all the tags of the source files, do the concatenation, and then add a header back in (if you want).

Thursday, November 13, 2003

Stickytape or glue usually does the trick.

(Waits for authoritarian regime to delete harmless post)

Thursday, November 13, 2003

Another, only slightly more labor-intensive way to do it is to import the files into an audio editing program, copy the waveforms from one of the MP3s, and paste it onto the end of the other, then save as a new MP3.

I've done this a few times and it works fine, takes about five minutes all told (if you're just joining two MP3 files). There are some cheap or free audio editing programs for Windows.  I use my Mac for all my audio stuff and the program I use is Amadeus II, a $30 shareware program that works like a charm.

Thursday, November 13, 2003

You'll want to do what Brad does to add audiable breaks and transitions anyway.

Li-fan Chen
Thursday, November 13, 2003

Not to mention volume normalization. Some of peaks and valleys will just drive you nuts.

Li-fan Chen
Thursday, November 13, 2003

Yes if you join two clips that aren't silent at the break point, you'll get an audible "pop" at the instantaneous transition between the two sounds.

I'd be worried about buffering issues. MPEG video streams can usually be concatenated byte-by-byte, but the resulting stream can be out-of-spec if it overflows the mandatory decoding buffer size (VBV). I'm not sure if this is true for MPEG audio.

Dan Maas
Thursday, November 13, 2003

I think AlbumWrap might do what you want:
Thursday, November 13, 2003

"you'll get an audible "pop" at the instantaneous transition between the two sounds"

True if the files were waveform data like .wav or .aiff but I'm not convinced that a format made of windowed blocks in frequency space is going to necessarily be as poppy as you think.

Let's try 'cat' and see
Thursday, November 13, 2003

What happens if the two mp3 files are different bitrates and frequencies?
Friday, November 14, 2003

*  Recent Topics

*  Fog Creek Home