Use MP3 Diags in Linux to repair your MP3 collection

Jack Wallen
Nov 24, 2009
Updated • Feb 15, 2018
Linux, Music

Do you have a massive MP3 collection that contains files with problems? Don't you wish you had a program that could search through that collection, find problems with those files, and fix the problems?

Fortunately for all of your MP3 horders, there are programs for just that task. One of those programs, for the Linux operating system only, is MP3 Diags. This application is an open source app will serve as your one-stop shop to identify and repair over 50 different problems that can occur with MP3 files.

You might think, because of the nature of the task surrounding this tool, that MP3 Diags would be challenging to use. It's not. In fact it's quite simple to scan and repair your music collection. In this tutorial you will learn how to install and use MP3 Diags to diagnose and repair your broken MP3s.

NOTE: Martin covered using MP3 Diags for the Windows operating system in his article "Diagnose your MP3 collection with MP3 Diags". Since there are issues to over come when using this application in the Linux operating system, I decided it was beneficial to cover it once again.

What can it fix?

Some of the problems that MP3 Diags can repair are:

  • Adding/fixing track info.
  • Correcting song duration times.
  • Correcting seek problems.
  • Renaming files based on fields.
  • Low quality audio.
  • Missing VBR header.
  • Missing normalization data.
  • and much more.

Now before I continue on, I will tell you that MP3 Diags can be resource intensive. If your collection is large you can expect this to take some time. During an initial scan MP3 Diags was running at approximately 2,000 files every 15 minutes. You can do the math from there.


MP3 Diags should be found in your distributions repositories. If you are using Ubuntu you can either open up Synaptic or the Ubuntu Software Center, do a search for "mp3 diags" (no quotes) mark the application for installation, and apply the changes.

When the application is installed you will find it in your Sound & Video menu entry.


When you first start up MP3 Diags a window will appear asking you to create a file which the application can save its configuration data. You can place this file anywhere you have write permission. In that same window you can set up a scan by including the directories you want to scan. In most modern Linux distributions you will find a ~/Music directory. If you're like me (and you like to keep everything well organized), you can just select that folder and begin the scan.

During the scan expect your machine to become a big sluggish. You might want to start the scan and walk away (to keep yourself from getting a wee frustrated). When the scan is over, the real fun begins.

Scan results

Figure 1
Figure 1

Take a look at Figure 1.  What you are seeing is the results of a first-run scan containing over 2,000 audio files. Near the top (under the tool bar) is a listing of all the possible issues that each file contains. Let's just look at one file.

To show only one file highlight that file and click the "Show One Song At a Time" button (Sixth button from the left on the toolbar). I will select a file, downloaded and converted from Youtube, of Rush's La Villa Strangiato. Obviously, since this was a download from Youtube, the audio quality is going to be poor. So let's repair that as much as it is possible.

Figure 2
Figure 2

Once you have your one file selected (see Figure 2) click the first work icon on the left (that's the first hammer on the left) which is a drop-down. When you first click this you will get a warning that says "although this works on the developers' machine, it might not work on yours". Take this as a caution and back up your files before you start working on them.

From the drop-down you will see numerous fixes for your file. However, instead of searching from the drop-down, you can hover your mouse over hammer icons labeled 1-4. Each of these contains a pre-configured set of fixes that allow you a single click to fix numerous, related issues on a file. For my poor audio quality file you can see it suffers from four issues:

  • fa - No ID3V2.3.0 tag found
  • ea - ID3V2 tag doesn't have APIC frame.
  • ab - Low quality MPEG audio stream.
  • an - No normalization undo data found.

When you go to fix these problems you will instantly come across an issue when using MP3 Diags in Linux. MP3 Diags uses the application mp3gain to normalize mp3 files, which is not installed by default. And, to make matters worse, MP3 Diags does not install this dependency for you. So you will have to fire up Synaptic, search for "mp3gain" (no quotes), select the results for installation, and apply the changes.

Once mp3gain is installed you can now normalize with MP3 Diags.

Another issue, specific to Linux, is that if you want to configure MP3 Diags to not erase original files, but instead to move them to another directory, you will need to make sure you change the destination directories in the preferences window.

By default all of the temporary directories are set to /tmp which you will have write access to, but if you want to archive that file you do not want it saved in the /tmp directory, because it will be deleted automatically. Different distributions handle this task differently - some clean up /tmp regularly, some upon reboot, some will empty a file in /tmp after it has gone untouched for a pre-determined span of time (usually 30 days). If you want to keep those original files around, you will want to reconfigure MP3 Diags to use a different directory than /tmp.

Final thoughts

After running MP3 Diags on my music collection, I have found that all MP3 files do, in fact, sound better and have far fewer issues. You should definitely give this application a go if you have a collection of MP3s lying around in need of repair.

Use MP3 Diags in Linux to repair your MP3 collection
Article Name
Use MP3 Diags in Linux to repair your MP3 collection
MP3 Diags is an open source app will serve as your one-stop shop to identify and repair over 50 different problems that can occur with MP3 files.
Ghacks Technology News

Tutorials & Tips

Previous Post: «
Next Post: «


  1. Jaron said on June 27, 2011 at 11:11 am

    The easier way is to use Foobar 2000 – add files, right click – Convert – Convert to a Single File and choose desired format and options.

    1. kktkkr said on June 27, 2011 at 7:12 pm

      I personally like this method as it is the fastest way to combine files. You can also use a DSP to remove silence, which may come in handy.
      The only complaint I have is that there is no easy way to manually control the volume of each track in the output.

      Bear in mind that for encoding to MP3 in Audacity/foobar2000 you will need a compiled(?) version of LAME encoder.

    2. max said on December 8, 2016 at 11:27 pm

      There is no option to convert to a single file in the Foobar. (I selected Mp3 output).

  2. jaomadn said on June 27, 2011 at 1:36 pm

    If the process is to merge the multiple mp3 used mp3wrap command line package to wrap multiple mp3 files and use sound or audio converter to any format you like. or use ffmpeg and mp3wrap for full auto merge and convert using search, identify format, merge and convert script.

    1. Paul C said on February 2, 2018 at 3:51 pm

      I know this is old, but I came here today looking for a solution to stop my mp3 player playing audiobook chapters/tracks out of order and others might too! (tried all the other renaming ways etc but no luck.)

      I found a way to merge multiple files in Audacity (which is brilliant and free btw):

      file menu – import – select all files you want to merge
      select menu – select all
      track menu – align tracks end to end
      file menu – export – export as mp3

      NB: do not ‘open’ the files as it will create a new window for each. Do not ‘export’ without staggering them first otherwise it will merge the files on top of each other rather than end to end and will just sound like white noise.

      1. John, UK said on July 30, 2018 at 3:25 pm

        Thank you for this. I was looking to do exactly the same, and it works just as described. One small point, you can also “drag and click” a group of audio files into Audacity as an alternative to the “import” option. It worked with my mp3, so presumably also with other formats.

      2. Emanuel said on October 7, 2018 at 4:38 pm

        file menu – import – select all files you want to merge
        select menu – select all
        track menu – align tracks end to end
        file menu – export – export as mp3

        Worked Perfectly!

        Thank you!

      3. Nyks said on June 20, 2019 at 9:49 am

        Thanks a lot!

        > select menu – select all
        The “Select all” now is in another menu (maybe a change in Audacity):
        Edit / Select / Select all

  3. Roman ShaRP said on June 27, 2011 at 2:03 pm

    1) You should know that there are 2 types of wavs a) uncompressed wav b) so-called RIFF-wav. The difference between second and mp3 is only in header.

    I discovered this long time ago. The only (alas) program I know which is capable of adding/stripping RIFF header and making RIFF-wavs from mp3s is cd grabber CDEX. I still have it installed solely for RIFF job I occasionally need.

    Some audio tracks in video are RIFF-wavs, I don’t know if it makes difference for VirtualDub, but it is big difference in size between uncompressed and compressed wavs.

    2) As for me, the easiest way to split-join mp3s (and without re-encoding) is famous Mp3directcut . I made joining of 2 files of the same bitrate literally in no time. Of course, if there are different bitrates, I probably had to re-encode.

    1. jarri scheil said on November 21, 2017 at 3:46 am

      Except for the hijacking of your search engine:

      Don’t forget to Click

      You will not be able to proceed until you check a box to set as your New Tab page or default search.

  4. Roman ShaRP said on June 27, 2011 at 2:14 pm

    Oh, I should tell where is joining in Mp3DirectCut:

    File -> Batch processing -> Check “Join to file” and enter file name.

  5. Arbie said on July 18, 2011 at 5:30 am

    Is there an easier way? Well there are certainly other ways. One way that is more “visual” and versatile is to import all the tracks and use the time shift tool (the double headed arrow) to move the files into the proper places. You can visually see the overlaps and adjust the fade out and fade in (if you are going to do that) with the envelope control or the fade out and fade in the effects dropdown. When satisfied with your efforts select “export as mp3” or “export as wave” as desired and your project will mixdown to a stereo file in your desired format.

  6. seoras said on March 23, 2016 at 11:26 am

    All much more cumbersome than Insert>Append as used in an older audio editor, the name of which escapes me.

    1. Patrick said on February 8, 2017 at 8:02 am

      Cooledit Pro, I think (now : Adobe Audition)

      I haven’t thought about about this one ;)

  7. Shabalala said on February 27, 2018 at 1:28 pm

    The above info is from Paul C incomplete and confusing. Here is a more comprehensible method for Audacity 2.1.3 as of Feb 2018:

    Merge multiple files in Audacity:

    File – Import / Audio – select all files you want to merge
    Open (you have no choice here)
    Edit / Select -> All
    Tracks / Align Tracks -> Align end to end
    File / Export Audio – set file name and select file type you want (mp3)
    Click OK to accept message that tells you that all tracks will be merged into two channels

    1. Miki said on April 5, 2018 at 4:13 pm

      @Shabalala Great idea, tanks a lot.

    2. Brian said on April 14, 2018 at 7:14 pm

      Totally. Every time i come to this page I ignore everything and come right to this comment.

    3. Bess said on September 19, 2019 at 2:42 am

      Perfect! Thank you Shabalala. Cheers, Bess

  8. Quaternion said on June 12, 2018 at 11:34 pm

    What Brian said. Thanks @Shabalala.

  9. K Gangadhara Rao said on October 19, 2018 at 5:03 am

    There is no option ‘Align End to End’ in the Older version of Audacity. What to do?

  10. PJ said on December 21, 2018 at 4:41 am

    <3 comments for this reason: THE CORRECT ANSWER – thank you @Shabalala

  11. steve gershwin said on January 7, 2019 at 9:54 pm

    Hey all, I tried align end to end and also copy/pasting track 2 onto the end of track 1. Both of these options leave a noticeable gap/click. Anybody have any ideas? I have version 2.2.1

  12. Paul TW said on October 30, 2019 at 6:05 pm

    It is simpler to do this:

    Use File > Open so that the files appear in their own windows.

    Click on one of the files and Ctrl A to select all of it then Ctrl C (to Copy)

    Switch to the other open file in its own window and place your cursor where you want to merge the file and Ctrl P (to Paste)

    All done!

  13. daveclark966 said on January 26, 2020 at 4:04 am

    Avdshare Video Converter is the top one MP3 Merger which can easily merge more than one MP3 into one entire MP3 file without any quality loss. Besides, this powerful MP3 Merger also supports to change the merged MP3 format to another one, like MP3 to WAV, AAC, WMA, AIFF, FLAC, OGG, etc.

  14. Deryacenter said on February 27, 2020 at 12:34 am

    This page exists primarily to make it easier to search for alternatives to an application that you do not know under which section has been added. Use the links in the template at the top to view the main sections as separate pages.

  15. Jerry Smit said on June 29, 2020 at 5:37 am

    Am I the only one think Audacity is a little complicated to use? I have used several merging tools to combine my MP3 and WAV files. Some online tools like Clideo are slow to upload and download files. Then I tried Joyoshare Video Joiner. It supports multiple video and audio formats. Most important of all, it is very easy to use. Just several clicks! Then it finishes the merging. You can relax that Joyoshare can merge audios with zero quality loss.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.