Mp3Merge

by David | Jun 6, 2009 | 9 comments

Mp3Merge

Mp3Merge.png

Function:

Mp3Merge is a free application (source code included) which invokes the DOS copy command to concatenate mp3 files which have the same bitrate together without the need to re-encode the files. Its purpose is to facilitate this task for lots of mp3 files that need to be concatenated together.

Background:

I needed a tool to help me re-join many different sermons and other lectures that I had acquired that were broken up into 5-minute segments. I preferred not to do re-encoding because it takes too much time and processing power and I’m always concerned that re-encoding will significantly change the file size or recording quality.

I looked for freeware options but couldn’t find much. Mp3 File Merger seemed promising, but I wasn’t too sure if it was actually doing something. My further digging revealed that it simply created a DOS .bat file of copy statements with the /b (binary) switch. That made me say, “hey, I could write something that does that”. So I didn’t spend any time on the actual “copy” functionality, but worked on making the process quick, easy, seemless, etc…. for me. We’ll, I’ve done that. I like it. So why not let others use it too? So, I tried to clean it up a bit and throw together a basic help file and install process. Hopefully it will work for you too. For a fuller version of how it works, take a look at the html help online.

Modification:

I don’t have much time or desire to mess with it very much so I can’t promise that it will evolve much. But feel free to contact me if you have questions, feature requests or bug reports…we’ll see what happens! 😉 You can use the contact form on the right here, or better yet leave a comment below.

Translations:

I’ve created a non-elegant French translation of the interface (included…language is changable via an .ini file parameter) and I’d welcome corrections to that and a translation of the help file. I’d, of course welcome translations of any other language and will include them here if they come.

System Requirements:

I can’t say that I know all the real technical requirements, but it’s a Windows 32-bit application written in the AutoIt3 scripting language. I’ve tested it on Win XP Pro, Win 7 and Win 10. I would expect that it would function in at least Win 2000 or better. I can’t say for 98/ME. Feel free to try it, and let me know what it has worked on.

Thanks go to:

AutoIt3 scripting language

MediaInfo .dll

HelpMaker

Inno Setup

Download Version 1.0:

Context Menu registry snippet:

Big thanks to John Mays who sent me this .reg file snippet.  When you add this to the registry, you can right click on a folder with a list of .mp3 files and you’ll see a context menu item “MP3 Merge Folder”.  When you click on this, MP3Merge will start and those files will be in your list. Slick! Who doesn’t like to save some time and clicks?

To use this, simply create a text file (plain old notepad will even work) and copy these lines into it.  Save it as a “.reg” file (not .txt).  Double click on the saved file and respond to Window’s warnings that you indeed want to do this and it will be ingested into registry.  Then you’re good to go!

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\shell\MP3 Merge Folder]
"Icon"="\"C:\\Program Files (x86)\\Mp3Merge\\Mp3Merge.exe\",0"
 
[HKEY_CLASSES_ROOT\Directory\shell\MP3 Merge Folder\Command]
@="\"C:\\Program Files (x86)\\Mp3Merge\\Mp3Merge.exe\" -addfolder=\"%1\""

Change log:

2023-12-20 – addition of registry snippet

2009-06-06 – version 1.0 – initial released version

9 Comments

  1. Mike Foster

    Hi David, another thing this app is great for is rejoining mp3 file fragments that have been created due to a crash or disk error. Recently had a case where this happened and I was left with a bunch of file fragments.. headers in some, frames and tails in others. Was super easy to just line the pieces up in order and merge them using your GUI. A lot faster than copy/b or a hex editor! Thanks for a great program!

    Mike

    Reply
  2. David Leigh

    Thanks Mike!

    Reply
  3. Bodo

    Hey,
    great work!
    I’m looking for such a program for quite a long time. Didn’t knew, that mp3 files could be merged so easy (just by copying together). All the programs I tried created created small gaps between the single songs, but it seems that yours doesn’t.
    Do your program really just copy the stuff together, or do you tidy them first up (deleting id3 headers for example)?

    You helped me a lot. Thanks.

    Bodo

    Reply
  4. David Leigh

    Thanks Bodo.

    No, Mp3Merge is simply a happy face on the DOS “copy” command. Frankly, I’m surprised too that it works like that! 😉

    As to id3 tags, I believe that most media players will simply read the id3 tag at the beginning and that the rest (which I believe would still be there) are ignored. So, I think that two mp3 files with different tags will result in a single file with the first tag being readable and the other simply wasting bytes.

    If anyone knows more about that, I’m open to correction!

    One other program that I know of that can merge mp3 files of DIFFERING bit rates without re-encoding (Mp3Merge does that only with files of the same bit rate), is Mp3DirectCut (https://mpesch3.de1.cc/mp3dc.html) and I would guess that it will process the file “intelligently” and strip extra id3 tags, etc. (You have to access its “batch” function to be able to do this sort of merge).

    Reply
  5. Bodo

    I tried a bit and found a problem. I merged a mixcd. The resulting file can be played with the players I tried (windows media player and my mobile phone) but both displays as length just the length of the first song (and so e.g. the progress isn’t displayed correctly). Only VLC did everything write.

    Reply
  6. Bodo

    Ok, forget it… the files have different bitrates… I guess thats the problem

    Reply
  7. David Leigh

    I do find it interesting that it PLAYED ok! Since I don’t mess with any mp3 file specifics, I could definitely see where different players might see different things (i.e. headers of the initial file that don’t account for the other files merged with it) and not know what number to “trust”.

    I may have to look into mp3 “repair” tools that I could call at the end which would simply set the header values to the total of the actual resulting file.

    At any rate, thanks for the feedback!

    Reply
  8. brian

    Hi, a very interesting program.
    My use for this is similar to Bodo to recombine music mixes to one file. Then create a cue file for use in a music player, so it appears as a playlist would, but plays seamlessly.

    For Bodo, if you are still around 🙂
    I found same issue as you, but i told Foobar player to “Fix VBR header”. This corrects the length to that of whole file, thus making it play correctly, even one with variable bit rate as mine was. Hope that helps.

    So, the program does build from VBR input files.
    However, what I found was a slight glitch (not a gap per se) at the join points, when using variable bit rate input files.
    My next step was to tell Foobar to “rebuild the mp3 stream”, which removes all non-frame (i.e. extra headers) info from the file, but sadly the slight glitches still remain.

    Maybe it’s possible to use a different tool from DOS copy to do the concatenation part?
    Any thoughts on this?
    I may try to write my own script, as this is proving a difficult problem to solve 🙂

    best regards
    bee

    Reply
  9. David Leigh

    Brian,
    I did some checking to see if there were an easy command-line drop-in replacement for the DOS copy that was mp3-aware. I didn’t find anything yet.

    I DID find some interesting things that might be good alternatives. “Merge MP3” at https://www.shchuka.com/software/mergemp3/ seems to be fairly full-featured and mp3-aware and I *think* it does the merging without re-encoding.

    I also saw on the foobar2000 wiki some more explanation of gaps: https://wiki.hydrogenaudio.org/index.php?title=Gapless

    As much as I’d love to say I wrote the greatest thing since sliced bread, I know I didn’t and I don’t have the time to really dive deeply into mp3 header/tag manipulation. If someone offered more of a command-line thing (like some of the linux-based utilities), I might give it a whirl.
    Thanks!
    David

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Archives

Categories

Important links

leighweb.com – our family web site
surleslinteaux.leighweb.com – my wife’s French Sunday School blog
eglisejosue.fr – our church in France
tdr-guebwiller.eu – our house of prayer (HOP) in France
informatique.leighweb.com – My web development freelance business
My CV/Resume in English (PDF)