PHP Classes

Id3 Tag Correction and Downloading: Correct ID3 tags of music stored in a database

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2015-01-12 (10 months ago) RSS 2.0 feedNot enough user ratingsTotal: 1,124 This week: 1All time: 3,176 This week: 1,127Up
Version License PHP version Categories  
tag_correction 1.0GNU General Publi...4.0Databases, Content management, Web se..., A...
Description Author  

This class can be used to correct tags of MP3 tags of music with records stored in a MySQL database.

It scans a MySQL database table with information about music albums to see which albums did not have yet the associated ID3 tags.

The class accesses Web services APIs of sites like,, and to correct the pending music tags and get other details about the stored music like: album, title, artist, genre, etc..

Innovation Award  
PHP Programming Innovation award nominee
June 2008
Number 9
MP3 music files may contain tags called ID3 that serve the purpose of identifying relevant aspects of the music like the title, album, artist, genre, etc..

Usually these tags have to be added to the music MP3 files manually. This allows for human editing errors.

This package implements a solution that can automatically fix music metadata information extracted from MP3 audio files and then stored in a MySQL database. It uses metadata obtained from remote sites with Web services APIs that provide the information.

Manuel Lemos
Picture of Nadir Latif
  Performance   Level  
Name: Nadir Latif is available for providing paid consulting. Contact Nadir Latif .
Classes: 16 packages by
Country: Pakistan Pakistan
Age: 32
All time rank: 801 in Pakistan Pakistan
Week rank: 1 Up
Innovation award
Innovation award
Nominee: 9x

Winner: 1x

Made by: Nadir Latif (


-mp3 management script written Nadir Latif (
-nusoap script (

This script uses web services to correct id3 tags and download lyrics, album art and information about the artist. The script uses the database of meta tags that is used by the mp3 management script.

1) Usage:

-Enter database configuration settings in
-Set the variable $path_symbol to "/" if running on linux or "\" if running on windows.
-Enter email of user in set_error_handling.php. All php errors except for notices will be sent to this email address.
-Set the variable $album_art_folder to the location of the album art folder. The downloaded album art images will be saved to this folder.
-To run the script directly from the browser instead of as a background task, set $is_debug variable to 1 and comment line 4. This will display error messages on screen instead of emailing the error.
-Copy the files to the directory of a web server and run index.php.

2) What does this sctipt do?

Most mp3s contain missing or misspelled id3 tags. For sites that host thousands of mp3s, it is not feasible to correct these tags manually. This script tries to correct misspelled tags and fill in missing tags. It also retrieves album art, lyrics and additional artist information. The script retrieves all rows from the mp_id3_tags table (provided by the mp3 management script)that contain mp3 meta data such as album,title,artist etc. For each row the script tries to correct the tags by using the web serivces provided by The script also downloads album art, lyrics and additional artist information such as list of similar artists, list of top albums by an artist, list of top tracks by an artist, artist biography and artist genre. The album art is saved to a folder, while the rest of the information is saved to database. The script makes one call to a web service per second in accordance with the policy of, and lyricwiki.

3)List of files:

a)index.php (initial file)
b)correct_tags.php (main program file)
c) (database configuration file)
d)set_error_handling.php (used to set the error handler to a user defined function)
e)readme.txt (help file)

-Feel free to contact me for any assistance regarding this script.
  Files folder image Files  
File Role Description
Accessible without login Plain text file Conf. database configuration file
Plain text file correct_tags.php Class main program file
Accessible without login Plain text file index.php Example main program file
Plain text file set_error_handling.php Class used to set the error handler to a user defined function
Accessible without login Plain text file readme.txt Doc. help file
Accessible without login Plain text file LICENSE.txt Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%Total:1,124All time:3,176
 This week:1This week:1,127Up