PHP Classes
elePHPant
Icontem

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 del.icio.us Bookmark in del.icio.us
  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 (7 months ago) RSS 2.0 feedNot enough user ratingsTotal: 1,119 All time: 3,171 This week: 1,048Up
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 audioscrobbler.com, last.fm, lyricwiki.org and lyricsfly.com 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
Name: Nadir Latif is available for providing paid consulting. Contact Nadir Latif .
Classes: 14 packages by
Country: Pakistan Pakistan
Age: 32
All time rank: 841 in Pakistan Pakistan
Week rank: 67 Up2 in Pakistan Pakistan Down
Innovation award
Innovation award
Nominee: 9x

Winner: 1x

Details provided by the author  
Made by: Nadir Latif (nadir.latif@yahoo.com)

Dependencies: 

-mp3 management script written Nadir Latif (http://www.phpclasses.org/browse/package/4018.html).
-nusoap script (http://sourceforge.net/projects/nusoap/).

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 config.inc.php.
-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 audioscrobbler.com. 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 audioscrobbler.com,lyricsfly.com and lyricwiki.

3)List of files:

a)index.php (initial file)
b)correct_tags.php (main program file)
c)config.inc.php (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 config.inc.php 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,119All time:3,171
 This week:0This week:1,048Up