180 likes | 308 Views
Bruno Angeles McGill University – Schulich School of Music MUMT-621 Fall 2009. Adding MusicBrainz Support to jMusicMetaManager. Outline. Introduction jMusicMetaManager and MusicBrainz Some Programming Definitions ID3v1 vs ID3v2 Changes From java_mp3 to jid3lib
E N D
Bruno Angeles McGill University – Schulich School of Music MUMT-621 Fall 2009 Adding MusicBrainz Support to jMusicMetaManager
Outline • Introduction • jMusicMetaManager and MusicBrainz • Some Programming Definitions • ID3v1 vs ID3v2 • Changes • From java_mp3 to jid3lib • Code Sections of Interest • Finishing the Project • Improvements • //TODO: • Current Issues
What is jMusicMetaManager? • […] a tool for improving metadata associated with recordings by automatically detecting inconsistencies and redundancies. (McKay et al. 2006)
What is MusicBrainz? • MusicBrainz is a user-maintained community music metadatabase. http://musicbrainz.org/doc/AboutMusicBrainz
Some Programming Definitions • Object-OrientedProgrammingProgrammingparadigmObjects & Classes: Shapesexample • GUIGraphical User Interface • StringSequence of characters • Hash tableArray of values accessedwith a key
ID3v1 vs ID3v2 • ID3v1 • 30 bytes max per field • Metadataisat the end of the file • ID3v1.1: add 60 bytes to title, artist, album • (ID3v1.2: comment 3043 bytes) • ID3v2 • Use Frames (hash table) of max total size 256MB! • Internationalization: differentcharacter sets • Metadataisat the start of the file streaming • ID3v2.1, ID3v2.2, ID3v2.3 • ID3v2.4: not widelysupported
From java_mp3 to jid3lib • java_mp3 (even the latest release 0.4 December 2008) supports ID3v1 but only ID3v2.0 (i.e., revision 0) • jid3lib supports: • ID3v1.0 and ID3v1.1 • ID3v2.0 to 4 • Other JAVA libraries for ID3 tags: jaudiotagger, Entagged , AudioTT, Axone , ID3v2 Audio Text Tools, ID3v2 ChapterTool, Jaikoz, etc.
Code Sections of Interest • ID3 library change Metadata abstraction • Class RecordingMetaData:public RecordingMetaData(File mp3_file) • Reporting choices • Class AnalysisPreferenceshandleGUIselections • Report generation • Class AnalysisProcessornew methodreportMusicBrainz() • MusicBrainz querying • Class MusicBrainzProcessor • GUI
MusicBrainzProcessor Class Uses libmusicbrainz-javalibrary (revision 12315) for querying
reportMusicBrainz() • Iterate through all parsed files: • Fetch artist name • Fetch album name (using artist name) • Fetch title (using artist and album names)
Sample Report In browser
Improvements • More files cannowberead by the software! • Simplest report, full personallibrary (all MP3, no iTunes XML): • Previously: readonly 6 985/10 377 = 67% of ID3 tags (mostlybecause of ID3v2 revision > 0) • Now: reads 9 892 / 10 377 = 95% of ID3 tags • Character set whenreadingyear canbefixed • ID3 tag exception to investigate • Basic MusicBrainz support so far
//TODO: • Improve MusicBrainz hit rate • Handle weird character sets • Create an ID3 randomizer for testing purposes? • Add more options to the MusicBrainz report • Add MusicBrainz links to the report • Maintain all the metadata fields from the previous implementation • Try other available libraries that support ID3v2.4 • Use other MusicBrainz servers to avoid low query rate? • Figure out if the credentials are necessary
Current Issues • jid3lib: simplifies a lot of data fetching, but not everything! • Hash tables with different keys across revisions • Managed fields so far in my project: artist, album, title, composer, year (first 4 chars MUST be numbers), compilation, comments (only ID3v1), genres, bit_rate • Data integrity: • String fields that are converted to numerical values • Files with both ID3v1 and ID3v2 metadataRead v2, else read v1? Read v1, then overwrite with v2? • Handling different character setsÿþ 0xFF 0xFE signature of UTF-16 encoding
Current Issues (continued) • Random IOExceptions • Tags that exist in 2 places: • Comments / SongComments • Year / YearReleased • Compilation tag: only if folder contains “Compilation” • Limit of 1 query per second can slow down reporting • 10 377 queriestake a minimum of 2 h 53 min
References • McKay, C., D. McEnnis, and I. Fujinaga. 2006. A large publicly accessible prototype audio database for music research. In Proceedings of the International Conference on Music Information Retrieval. Victoria, Canada. 160–3. Links Dan O’Neill. 2009. Home – ID3.org. http://www.id3.org/ (accessed 26 November 2009) Cory McKay. 2006. jMusicMetaManager. http://jmir.sourceforge.net/manuals/jMusicMetaManager_manual/Manual.html (accessed 26 November 2009) EricFarng. 2005. Java ID3 Tag Library. http://javamusictag.sourceforge.net/(accessed 26 November 2009)