Background

Mp3Merge Background
 Top Next
Mp3Merge was born out of the marriage of necessity and inspiration.

Necessity:
The necessity was that I had a boatload of mp3 lectures that were chopped into 5 minute segments. At one point in time, that suited me just fine when my ancient mp3 player didn't keep my place within a given file that was being played. I've since upgraded to something a bit more powerful and now, all those 5-minute files are simply annoying. I have a LOT of these lectures so I needed something that made this task relatively painless. Being cheap (the reality of the altruistic "software should be free" mantra), I was looking for a freeware solution. Additionally, I wanted something that would do the job WITHOUT recoding. There are already some good freeware solutions that will merge mp3 files, but do so with recoding the file. This is slow and I never know what this might do to the quality of the file. The original may not be great, but I didn't want it to be worse!

Inspiration:
The inspiration came after doing the usual freeware/open source searching and not finding much...but one application called Mp3 File Merger . I downloaded it and tried it out. It had a very simple interface...a bit TOO simple for my needs. I couldn't tell if it was doing or had done anything when I used it! I went looking in its directory for more help or examples or a readme or SOMETHING to give me a clue as to how it worked. In doing so I stumbled upon a .bat file. I looked inside and low and behold, it was a series of DOS "copy" commands that were copying my mp3 files, one on to the next in a series of commands.

All this thing was doing was a DOS copy with the "/b" (binary) switch. That was its amazing secret! Heck, even I can do that!

Well, with my inspiration to build a better mousetrap...er...better mp3 file merger, I took my limited Autoit skills firmly in hand and set out. Some fun coding and not-so-fun head-banging created Mp3Merge. I must say that at least at its outset, it's coded for my needs, not yours. I wanted to make it at least available to the world, but I'm not really dedicated to making it exactly what everyone wants. So if you want to add functionality, you're welcome to take it all and make your own thing with it (attribution is always nice), or to offer code that I can add to the program. You can request help from me but I can't guarantee that I'll be able to help or to modify the program. It simply is not that high a priority for me.

My goal is to meet a need of mine and hope that at the same time I can help others who have the same need.


What it does
 Previous Top Next
Mp3Merge is ridiculously simple.

All that Mp3Merge does is use the DOS "copy" command with the "/b" (binary) switch to copy two mp3 files together. It does this for each of the files in the list and thus achieves a "merge" of the mp3 files in the list.

For example you could type in the following on a DOS command line and achieve the same thing (or put them in a .bat file, of course):

Copy /b "c:\file01.mp3" "c:\mergedfile.mp3"
Copy /b "c:\mergedfile.mp3"+"c:\file02.mp3" "c:\mergedfile.mp3"
Copy /b "c:\mergedfile.mp3"+"c:\file03.mp3" "c:\mergedfile.mp3"
Copy /b "c:\mergedfile.mp3"+"c:\file04.mp3" "c:\mergedfile.mp3"

So, now mergedfile.mp3 simply has file01.mp3, file02.mp3, file03.mp3 and file04.mp3 concatenated together.

Mp3Merge simply helps you gather those files together and executes the command for you. That's all!


User interface reference
Here's the Mp3Merge user interface:

Here's a rundown of the elements of the user interface:

Add button

The Add button invokes the standard Windows "add file" dialog. In this dialog you can select multiple files. These are the files that will populate the file list window. After having added files, you can continue to use the add file button to add files from other directories as needed. Mp3Merge remembers the directory you navigated to across executions by storing it in the ini file (yes, I rather loathe the registry). The stored working directory will also be used when you click the browse button.

Merge button

The Merge button is what actually invokes the merge process. At this point all the files in the list are used in the merge process and are done in the order in which they are displayed. This means that you must get the list the way you want it before using this button. This is done via adding and removing files from the list and via sorting the list in the way you want (see the Order column and experiment with clicking on the column headers).

Clear the list button

The Clear The List button simply removes all the files from the list.

View Log button

The View Log button invokes the default text viewer (this can be set in the ini file) to view the log file. Certain actions that are performed while using Mp3Merge are logged in the log file. Via the ini file, you can choose to have the log file overwritten for every execution or choose to append it for every execution.

Exit button

The Exit button simply exits you from the program (as does the standard "x" button in the upper right-hand corner).

Output file field

The Output file field is where you put the name of your output file. This file will be overwritten if it exists. If you want the output file of a previous execution used again, you'll need to do a 2-file process where "file1" is the output of "merge process 1" AND the input of "merge process 2". "file2", the output of "merge process 2" could then be used as input and the other as output and so-on and so-forth. This was not a direct need of mine so I did not code for it.

Browse button

The Browse button lets you browse to select a single file as an output file. It will use the active working directory of the application (stored and kept up to date in the ini file). Add file navigations will change the working directory but browse navigations will not. A technique I use is to pick one of the input files (typically that have an iterative number in their name) as the output file using the Browse button and then remove the iterative portion of the file name in the Output File Field.

Progress Bar

The Progress Bar shows progress in the adding of files (where the media info is gathered as the files are added to the list) and in the merge process itself.

File list

The File List is where you see what files you will be working with in the merge process. The manipulation that you can do is to:
· add files to the list
· remove files from the list via a right-click context menu option (where all selected lines can be removed...i.e. select one or more lines, right-click, choose the remove option and they're gone)
· order files via clicking on the column headers (alternate ascending/descending sort)
· order files via right clicking on a line and choosing to edit the order number. Then you must click on the Order column's header to reorder according to the new numbering.

File list - Order column

The Order column exists because of some of the limitations of Autoit (not complaining...it's a wonderful and amazing language with a great coding environment) and my own limitations as a programmer. I couldn't get dragging/dropping to work for reordering and there was a feature to facilitate editing of the first column in a list. So with the order column, one can right-click on a row and choose to edit the order column number. Then one must click on the Order column to actually do the re-sorting. This allows a granular level of file sorting if necessary.

Note: as files are added to the file list during a single execution of Mp3Merge, the order number will continue to be incremented by 10. Even if you clear the list, the next added files will have the next highest order numbers. This is only reset at program termination.

File list - Directory column

The Directory column shows the directory name of the file on that line. It is separate from the file to facilitate different kinds of sorting as necessary.

File list - File column

The File column simply shows the file name without the full path in front of it.

File list - Size column

The Size column comes from the MediaInfo dll that is called as each file is added. It is in bytes (as opposed to Kbytes or Mbytes).

File list - Duration column

The Duration column comes from the MediaInfo dll that is called as each file is added. It shows the total duration in milliseconds.

File list - Bitrate column

The Bitrate column comes from the MediaInfo dll that is called as each file is added. It shows the bitrate file was recorded with in bits (not Kbits). My understanding is that while Mp3Merge will merge any Mp3 files you throw at it, if your bitrates do not match, then you will not be able to play the file.

File list - Title column

The Title column comes from the MediaInfo dll that is called as each file is added. It shows the mp3 tag Title field.

File list - Artist column

The Artist column comes from the MediaInfo dll that is called as each file is added. It shows the mp3 tag Artist field.

Right-Click checkbox

The Allow right-click add of folders checkbox facilitates invoking Mp3Merge via a right-click system context menu on a folder in Windows Explorer. If this box is checked, a registry entry is written to add this system context menu item for folders ("open with Mp3Merge"). Then you can right-click on a folder Mp3Merge will be invoked and all the mp3 files in that folder (no sub-folders) will be added to the file list.

Status bar

The Status bar will show certain status messages, but its most important function is to show you at all times:
· how many files are in the list
· what would the total duration of the merged file be
· what would the total size of the merged file be


Typical use sequence
Your basic steps to use Mp3Merge would be as follows:

1. Click the Add button
2. Choose your files to merge and click "open" - they are added to the list
3. Remove any files you don't want via selecting the row(s) and right-clicking and choosing "remove selected files from the list" - they are removed
4. Do any re-ordering of the list that you wish. This is either a 1 or 2-part process. You can simply click on the header columns to alternate between ascending and descending order of the list via that column. Alternatively or more granularly, you can right-click on a row, choose "change the order of this item" from the context menu, type a new order number that corresponds with where you want the file to fall in the numerical order of the "Order" column and then click the header of the "Order" column to complete the sorting process.
5. Type in an output file name or use the "Browse" button to navigate to a file. The Browse button follows the current working directory by default. This is an assumption that the series of Mp3 files to merge are named in such a way that one simply has to remove a sequence number and you have a desired output name. Hence, one can use the browse button, select one of the input files, click "Open", and then simply remove the sequence numbers in the output file name field.
6. Click on Merge. This is certainly faster than re-encoding the file, but it can take a little while to do the copies anyway.


Notes
· Certain Mp3Merge settings can be found in the .ini file (somewhat documented as well)
· The interface for Mp3Merge can also be seen in French (my lousy translation...at least until someone sends me a better one! ). A setting in the .ini file changes which language .ini file is used.
· More language translations (interface AND help file) are welcomed as contributions!
· Help file created using HelpMaker 7.4.4
· I use the MediaInfo dll to get the bitrate and duration of the mp3 files
· To call MediaInfo from Autoit3, I used some code that I found in the Autoit3 Forums .


Caveats
 Previous Top
· Mp3Merge is free and open-source - do what you want with it.
· It's written in Autoit3
· It's written for my needs and I'm happy to share
· I've only tested so far on Windows XP Pro
· I've only limited time to support it - no guarantees for fixes or updates
· I believe that merged files of different bitrates will not work
· I've not stressed tested it so I don't know its limits
· Contact me via our general contact form on our personal web site: http://www.leighweb.com/contact.php