This last week someone sent me a CD with fifty 60 second tracks (it was a presentation that someone inexplicably saved as fifty separate tracks instead of one contiguous fifty minute block) that they wanted ripped into a single MP3. Ripping is easy with CDex and my initial google search left with with Audacity, which looked promising but I couldn’t figure out how to merge multiple MP3 files into a single file (using Audacity that is). Finally, I came across this little gem on binarybonsai.com, where a commenter mentioned that you can use the DOS copy command to append one files (or multiple files) to one another, creating one big file from many. Syntax is as follows:
> copy /b file1.mp3 file2.mp3 file3.mp3 end_result.mp3
which combines file1.mp3, file2.mp3 and file3.mp3 into end_result.mp3. The /b switch indicates that you’re copying binary files.
What’s Going On Here?
My name is Aaron Johnson and I created this blog both for me (mostly) and sometimes you. I've been saving mydeliciouspinboard.in links here and blogging since 2002. During the week (and at night and some weekends and well.. most of the time), I work in engineering at Jive Software. When I'm not working, I'm hanging out with my amazing wife, ourdinosaurStar Wars loving son and four chickens in the burbs outside of Portland, Oregon.See Also
Monthly Archives
- June 2013 (2)
- May 2013 (6)
- April 2013 (4)
- March 2013 (3)
- February 2013 (5)
- January 2013 (7)
- December 2012 (1)
- November 2012 (4)
- October 2012 (5)
- September 2012 (3)
- August 2012 (3)
- July 2012 (7)
- June 2012 (5)
- May 2012 (3)
- April 2012 (5)
- March 2012 (5)
- February 2012 (9)
- January 2012 (9)
- December 2011 (10)
- November 2011 (6)
- October 2011 (6)
- September 2011 (5)
- August 2011 (5)
- July 2011 (8)
- June 2011 (13)
- May 2011 (3)
- April 2011 (10)
- March 2011 (6)
- February 2011 (2)
- January 2011 (4)
- December 2010 (8)
- November 2010 (12)
- October 2010 (9)
- September 2010 (6)
- August 2010 (4)
- July 2010 (8)
- June 2010 (9)
- May 2010 (4)
- April 2010 (9)
- March 2010 (6)
- February 2010 (9)
- January 2010 (10)
- December 2009 (10)
- November 2009 (10)
- October 2009 (6)
- September 2009 (10)
- August 2009 (13)
- July 2009 (12)
- June 2009 (11)
- May 2009 (8)
- April 2009 (4)
- March 2009 (7)
- February 2009 (2)
- January 2009 (3)
- December 2008 (4)
- November 2008 (7)
- October 2008 (10)
- September 2008 (6)
- August 2008 (7)
- July 2008 (9)
- June 2008 (15)
- May 2008 (9)
- April 2008 (10)
- March 2008 (8)
- February 2008 (6)
- January 2008 (15)
- December 2007 (10)
- November 2007 (9)
- October 2007 (6)
- September 2007 (9)
- August 2007 (12)
- July 2007 (9)
- June 2007 (6)
- May 2007 (8)
- April 2007 (10)
- March 2007 (14)
- February 2007 (12)
- January 2007 (17)
- December 2006 (11)
- November 2006 (11)
- October 2006 (8)
- September 2006 (11)
- August 2006 (14)
- July 2006 (11)
- June 2006 (13)
- May 2006 (11)
- April 2006 (8)
- March 2006 (5)
- February 2006 (7)
- January 2006 (8)
- December 2005 (6)
- November 2005 (6)
- October 2005 (9)
- September 2005 (3)
- August 2005 (11)
- July 2005 (12)
- June 2005 (11)
- May 2005 (4)
- April 2005 (5)
- March 2005 (8)
- February 2005 (5)
- January 2005 (3)
- December 2004 (6)
- November 2004 (7)
- October 2004 (4)
- September 2004 (9)
- August 2004 (5)
- July 2004 (10)
- June 2004 (12)
- May 2004 (4)
- April 2004 (13)
- March 2004 (10)
- February 2004 (9)
- January 2004 (13)
- December 2003 (8)
- November 2003 (9)
- October 2003 (17)
- September 2003 (28)
- August 2003 (21)
- July 2003 (24)
- June 2003 (31)
- May 2003 (43)
- April 2003 (30)
- March 2003 (48)
- February 2003 (45)
- January 2003 (43)
- December 2002 (28)
- November 2002 (30)
- October 2002 (34)
- September 2002 (41)
- August 2002 (35)
- July 2002 (20)
- June 2002 (1)
Funny idea, but I tried anyway! Instead of the old dos “copy” I used the unix “cat” command with pipe:
cat file1 >> newfile
cat file2 >> newfile
etc.
(use loop instead of list: for i in *.mp3; do; done)
“>>” is the token for “append” file instead of overwriting file.
And it works! The new combined mp3-file can be played on xmms.
Never thought it would be so easy!
Or in the future, you can have Cdex do it while it rips:
http://cdexos.sourceforge.net/faqs.php#cdex18
What you can do is to to select several tracks, and hit the partial track copy, with this option you can select a range which is ripped/encoded into one big file.
I tried it on xp and it worked great!
This has solved my problem big time! I was searching for ActiveX dlls to do the same for quite long for my site.
BTW, syntax on XP is:
> copy file1.mp3 + file2.mp3 + file3.mp3 end_result.mp3
Thanks for the info. ajohnson
Hmmm, I tried Armjamil’s XP syntax but it didn’t work for me. I used it to combine 3 mp3′s totaling 11MB and the output file was only 3KB. Well then, I’m off to search for another solution…
To do it with Audacity just open both files you want to merge. In the first file set the cursor to the end (Edit->Move Cursor->End of Track). In the second file select everything (CTRL-A) and copy it (CTRL-C). Go back to the first file, paste the second file (CTRL-V) and you are ready to go. To do it with 50 files though is a PITA, so your way may be better.
FYI the XP syntax above needs the /b binary switch inserted, as described in the original post, and then it works great, almost instantly.
The windows xp command needs the /B not /b.
Thank you, thank you, thank you!!! This was so easy and here I thought I was going to have to buy something…
Thanks again!
can u belive there are programs out there who need registering – money payed to do this. I just couldn’t belive it would work, but i tried it and it does. If u have more mp3 files just put them into a directory and type:
copy /b *.* big_mp3_file.mp3
It’s a very nice way to merge files. There is one problem. The headers of mp3-files are also merged.
What those “have to register and/or pay” programs do is remove the header of the next file(s) and adjust the header of the first file. There is alot of info in the header, like ID3tags, audio length, … that should be removed or adjusted…
Wow! Thanks alot! I was trying to figure out an easy way to do this with audacity as well. I made a one line .bat file with balamaci’s comment. Now all I have to do is run the file in any directory with all my files in it!
copy /b *.* big_mp3_file.mp3
I’m using Audacity to resample/save it. Hopefully that will clean up the header issue.
Nice!
I do it using cat:
$ cat *.mp3 >big.mp3
Thanks very much. I was just about to give up when I found your tip. (Thanks too to Armjamil for the XP tip and to AgapeDesciple for reminding me about bat files.)
Thanks very much for the original info – works a treat. If you ensure files are sequentially numbered it will ensure they are appended in the right sequence.
Note to dave31175 – no doubt he has now solved or given up, but if you copy without the /b modifier, it will not copy MP3 correctly. You must use /b after the copy command
ie copy /b *.* test.mp3
Again thanks for the original suggestion!!!
Glad to find this info. I needed to merge a bunch of MP3s to accompany a freeware slideshow app which will play a single MP3 while the slides rotate.
Couple of things to note:
- you can easily edit the ID3/ID2 tags using a free player like Winamp
- I needed to add a break between each track, so I created an MP3 of 2 seconds of silence using Audacity. Put this between each track (and at the start or end if you plan to loop the audio) to create some breathing room.
Thanks again…
AWESOME!!! thanks for the solutions guys.
I love the Internet and I love you guys thank you so much… very cool.
THANK YOU, THANK YOU! How easy. 3 1/2 years and it still does a fine job in Win XP.
Here is what worked for us (remembering that DOS files need to have file names of 8 characters or less, and we used the lower case “b”):
copy /b file1.mp3 + file2.mp3 end_file.mp3
WOO-HOO!
The thing is i want to actually mix the sound files so they are one file but they play together. One file has words but it needs music to it, so i just want to combine the two audion mp3 files and intertwine them.
Trick I use with this is to first use id3remover to clean the MP3 files first. If there are multiple directories (e.g., series of CDs for a book) I use the following command from the directory where the subdirectories contain the MP3 files:
for /f “delims==” %A in (‘dir /on /ad /b’) do copy /B “%A\*.mp3″ “%A.mp3″
Very neat and fast.
Sorry, this may be a dumb question, but I’ve gone into DOS and can add those files… then it lists my files’ names and says 1 file copied… but where does the end_result.mp3 file end up?
The command line worked incredibly well however what I am trying to find is a way to merge them without the breaks in between the tracks….if anyone has a suggestion it would be helpful
Thanks
After that copying, the big mp3 file is shredded by multiple headers from input mp3s. To fix the stream and write correct time for it you need use Foobar2000 (simply and great mp3 player). For CBR mp3s Right click on big mp3 file than choose Utils and next “Rebuild MP3 Stream”. For VBR mp3s use Utils -> “Fix MP3 VBR header”. And for mixed input mp3s use both methods
Enjoy.
If you have multiple files then you would need to use append, right? Otherwise each file would write over the target file. Try this instead:
$ cat *.mp3 >>big.mp3
Those of you who are looking to get this done for free could try a Linux test drive CD, they can access a Windows drive and let you do Linux commands like this on them (using an Xterm console).
> Nice!
> I do it using cat:
> $ cat *.mp3 >big.mp3
Wow! simple solution that works great with Windows 7 thanks
WINDOWS 7: Followed the above. Couldn’t have been easier. Recap:
In windows explorer create a new directory inside the c> directory. Let’s call it “test”. Put the files you want to merge into that directory
Hit Start, type “cmd” in the box to get to dos prompt. If you find you’re in a dos subdirectory, such as c> windows then type two dots (..) and hit return to get you to c>
Then type cd_test (use a space instead of the underscore)
now it looks like this:
c>test>
Here’s the syntax
c>copy_B/_*.*_NEWFILENAME.mp3 (make sure you put spaces where I have used underscores) (hit enter)
You’re done. Dos has created a new file with an mp3 extension. I just combined 120 files in ten directories. All was copasetic. I am pretty sure it puts the files together in alphanumeric order.
Win7 DOS will probably allow you to create a batch file. At the prompt type
edit_merge.bat (hit enter)
You will be shown a screen. Input the above “copy” command and save it. Next time you won’t have to retype the command every time, you just go to test> and type “merge” (and hit “enter”). Of course you can name the bat file anything you want.
Keep in mind, you will have to remove the merged file from that directory before you use the bat file again, because it will overwrite the one you created previously.
Oops, made a mistake. The command should be typed at the c>test> prompt.
c>test> copy_B/_*.*_NEWFILENAME.mp3