<p>I've got many, many mp3 files that I would like to merge into a single file.  I've used the command line method</p>

<pre><code>copy /b 1.mp3+2.mp3 3.mp3
</code></pre>

<p>but it's a pain when there's a lot of them and their namings are inconsistent.  The time never seems to come out right either.</p>

[{'answer_id': 62635, 'author': 'Thomas Owens', 'author_id': 572, 'author_profile': 'https://Stackoverflow.com/users/572', 'pm_score': 3, 'selected': False, 'text': "<p>The time problem has to do with the ID3 headers of the MP3 files, which is something your method isn't taking into account as the entire file is copied.</p>\n\n<p>Do you have a language of choice that you want to use or doesn't it matter? That will affect what libraries are available that support the operations you want.</p>\n"}, {'answer_id': 62736, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Personally I would use something like mplayer with the audio pass though option eg -oac copy</p>\n'}, {'answer_id': 62762, 'author': 'David Precious', 'author_id': 4040, 'author_profile': 'https://Stackoverflow.com/users/4040', 'pm_score': 7, 'selected': True, 'text': '<p>As Thomas Owens pointed out, simply concatenating the files will leave multiple ID3 headers scattered throughout the resulting concatenated file - so the time/bitrate info will be wildly wrong.</p>\n\n<p>You\'re going to need to use a tool which can combine the audio data for you.</p>\n\n<p><a href="http://mp3wrap.sourceforge.net/" rel="noreferrer">mp3wrap</a> would be ideal for this - it\'s designed to join together MP3 files, without needing to decode + re-encode the data (which would result in a loss of audio quality) and will also deal with the ID3 tags intelligently.</p>\n\n<p>The resulting file can also be split back into its component parts using the mp3splt tool - mp3wrap adds information to the IDv3 comment to allow this.</p>\n'}, {'answer_id': 62785, 'author': 'Chris M.', 'author_id': 6747, 'author_profile': 'https://Stackoverflow.com/users/6747', 'pm_score': 2, 'selected': False, 'text': '<p>MP3 files have headers you need to respect.</p>\n\n<p>You could ether use a library like <a href="http://osalp.sourceforge.net/" rel="nofollow noreferrer">Open Source Audio Library Project</a> and write a tool around it.\nOr you can use a tool that understands mp3 files like <a href="http://audacity.sourceforge.net/" rel="nofollow noreferrer">Audacity</a>.</p>\n'}, {'answer_id': 62793, 'author': 'szeryf', 'author_id': 7202, 'author_profile': 'https://Stackoverflow.com/users/7202', 'pm_score': 1, 'selected': False, 'text': "<p>I would use Winamp to do this. Create a playlist of files you want to merge into one, select Disk Writer output plugin, choose filename and you're done. The file you will get will be correct MP3 file and you can set bitrate etc.</p>\n"}, {'answer_id': 574439, 'author': 'joelhardi', 'author_id': 11438, 'author_profile': 'https://Stackoverflow.com/users/11438', 'pm_score': 2, 'selected': False, 'text': '<p>As David says, <a href="http://mp3wrap.sourceforge.net/" rel="nofollow noreferrer">mp3wrap</a> is the way to go. However, I found that it didn\'t fix the audio length header, so iTunes refused to play the whole file even though all the data was there. (I merged three 7-minute files, but it only saw up to the first 7 minutes.)</p>\n\n<p>I dug up <a href="http://lyncd.com/2009/02/how-to-merge-mp3-files/" rel="nofollow noreferrer">this blog post</a>, which explains how to fix this and also how to copy the ID3 tags over from the original files (on its own, mp3wrap deletes your ID3 tags). Or to just copy the tags (using id3cp from <a href="http://id3lib.sourceforge.net/" rel="nofollow noreferrer">id3lib</a>), do:</p>\n\n<pre><code>id3cp original.mp3 new.mp3\n</code></pre>\n'}, {'answer_id': 1245493, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>I\'d not heard of mp3wrap before.  Looks great.  I\'m guessing someone\'s made it into a gui as well somewhere.  But, just to respond to the original post, I\'ve written a gui that does the COPY /b method.  So, under the covers, nothing new under the sun, but the program is all about making the process less painful if you have a lot of files to merge...AND you don\'t want to re-encode AND each set of files to merge are the same bitrate.  If you have that (and you\'re on Windows), check out Mp3Merge at: <a href="http://www.leighweb.com/david/mp3merge" rel="nofollow noreferrer">http://www.leighweb.com/david/mp3merge</a> and see if that\'s what you\'re looking for.</p>\n'}, {'answer_id': 1479701, 'author': 'bmurphy1976', 'author_id': 1931, 'author_profile': 'https://Stackoverflow.com/users/1931', 'pm_score': 4, 'selected': False, 'text': '<p>Use ffmpeg or a similar tool to convert all of your MP3s into a consistent format, e.g.  </p>\n\n<pre><code>ffmpeg -i originalA.mp3 -f mp3 -ab 128kb -ar 44100 -ac 2 intermediateA.mp3  \nffmpeg -i originalB.mp3 -f mp3 -ab 128kb -ar 44100 -ac 2 intermediateB.mp3\n</code></pre>\n\n<p>Then, at runtime, concat your files together:  </p>\n\n<pre><code>cat intermediateA.mp3 intermediateB.mp3 &gt; output.mp3\n</code></pre>\n\n<p>Finally, run them through the tool <strong><a href="http://mp3val.sourceforge.net/" rel="noreferrer">MP3Val</a></strong> to fix any stream errors without forcing a full re-encode:  </p>\n\n<pre><code>mp3val output.mp3 -f -nb\n</code></pre>\n'}, {'answer_id': 1759464, 'author': 'Daave311', 'author_id': 214140, 'author_profile': 'https://Stackoverflow.com/users/214140', 'pm_score': 0, 'selected': False, 'text': '<p>Instead of using the command line to do </p>\n\n<blockquote>\n  <p>copy /b 1.mp3+2.mp3 3.mp3</p>\n</blockquote>\n\n<p>you could instead use <a href="http://www.softempire.com/the-rename-downloads.html" rel="nofollow noreferrer">"The Rename"</a> to rename all the MP3 fragments into a series of names that are in order based on some kind of counter. Then you could just use the same command line format but change it a little to: </p>\n\n<blockquote>\n  <p>copy /b *.mp3 output_name.mp3</p>\n</blockquote>\n\n<p>That is assuming you ripped all of these fragment MP3\'s at the same time and they have the same audio settings. Worked great for me when I was converting an Audio book I had in .aa to a single .mp3. I had to burn all the .aa files to 9 CD\'s then rip all 9 CD\'s and then I was left with about 90 mp3\'s. Really a pain in the a55.</p>\n'}, {'answer_id': 4350108, 'author': 'Adam', 'author_id': 529916, 'author_profile': 'https://Stackoverflow.com/users/529916', 'pm_score': 2, 'selected': False, 'text': '<p><em>What I really wanted was a GUI to reorder them and output them as one file</em></p>\n\n<p><a href="http://www.playlistproducer.com/" rel="nofollow">Playlist Producer</a> does exactly that, decoding and reencoding them into a combined MP3. It\'s designed for creating mix tapes or simple podcasts, but you might find it useful.</p>\n\n<p>(Disclosure: I wrote the software, and I profit if you buy the Pro Edition. The Lite edition is a free version with a few limitations).</p>\n'}, {'answer_id': 5364985, 'author': 'joelhardi', 'author_id': 11438, 'author_profile': 'https://Stackoverflow.com/users/11438', 'pm_score': 6, 'selected': False, 'text': '<p><a href="https://stackoverflow.com/a/62762/3195477">David\'s answer</a> is correct that just concatenating the files will leave ID3 tags scattered inside (although this doesn\'t normally affect playback, so you can do "copy /b" or on UNIX "cat a.mp3 b.mp3 > combined.mp3" in a pinch).</p>\n\n<p>However, mp3wrap isn\'t exactly the right tool to just combine multiple MP3s into one "clean" file. Rather than using ID3, it actually inserts its own <a href="http://mp3wrap.sourceforge.net/mp3wrap-format.html" rel="noreferrer">custom data format</a> in amongst the MP3 frames (the "wrap" part), which causes issues with playback, particularly on iTunes and iPods. Although the file <em>will</em> play back fine if you just let them run from start to finish (because players will skip these is arbitrary non-MPEG bytes) the file duration and bitrate will be reported incorrectly, which breaks seeking. Also, mp3wrap will wipe out all your ID3 metadata, including cover art, and fail to update the VBR header with the correct file length.</p>\n\n<p><a href="http://tomclegg.net/mp3cat" rel="noreferrer">mp3cat</a> on its own will produce a good concatenated data file (so, better than mp3wrap), but it also strips ID3 tags and fails to update the VBR header with the correct length of the joined file.</p>\n\n<p>Here\'s a <a href="http://lyncd.com/2011/03/lossless-combine-mp3s/" rel="noreferrer">good explanation</a> of these issues and method (two actually) to combine MP3 files and produce a "clean" final result with original metadata intact -- it\'s command-line so works on Mac/Linux/BSD etc. It uses:</p>\n\n<ul>\n<li><a href="http://tomclegg.net/mp3cat" rel="noreferrer">mp3cat</a> to combine the MPEG data frames only into a continuous file, then</li>\n<li><a href="http://id3lib.sourceforge.net/" rel="noreferrer">id3cp</a> to copy all metadata over to the combined file, and finally </li>\n<li><a href="http://home.gna.org/vbrfix/" rel="noreferrer">VBRFix</a> to update the VBR header.</li>\n</ul>\n\n<p>For a Windows GUI tool, take a look at <a href="http://www.shchuka.com/software/mergemp3/" rel="noreferrer">Merge MP3</a> -- it takes care of everything. (VBRFix also comes in GUI form, but it doesn\'t do the joining.)</p>\n'}, {'answer_id': 16752087, 'author': 'James', 'author_id': 410072, 'author_profile': 'https://Stackoverflow.com/users/410072', 'pm_score': 1, 'selected': False, 'text': '<p>If you want something <strong><em>free</em></strong> with a simple user interface that makes a <strong>completely clean</strong> mp3 I recommend <a href="http://mp3joiner.net/" rel="nofollow noreferrer">MP3 Joiner</a>.</p>\n\n<p><strong>Features:</strong></p>\n\n<ul>\n<li>Strips ID3 data (both ID3v1 and ID3v2.x) and doesn\'t add it\'s own (unlike mp3wrap)</li>\n<li>Lossless joining (doesn\'t decode and re-encode the .mp3s). No codecs required.</li>\n<li>Simple UI (see below)</li>\n<li>Low memory usage (uses streams)</li>\n<li>Very fast (compared to mp3wrap)</li>\n<li>I wrote it :) - so you can request features and I\'ll add them.</li>\n</ul>\n\n<p><img src="https://i.stack.imgur.com/TGvYH.png" alt="MP3 Joiner app"></p>\n\n<p>Links:</p>\n\n<ul>\n<li>MP3 Joiner website: <a href="http://mp3joiner.net/" rel="nofollow noreferrer">Here</a></li>\n<li>Latest installer: <a href="http://bytesoftly.com/Download/Apps/1/1.0/MP3JoinerSetup.exe" rel="nofollow noreferrer">Here</a></li>\n</ul>\n'}]
['https://Stackoverflow.com/questions/62618', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4230/']