Title: Adding MusicBrainz Support to jMusicMetaManager
1Adding MusicBrainz Support to jMusicMetaManager
- Bruno Angeles
- McGill University Schulich School of Music
- MUMT-621
- Fall 2009
2Outline
- 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
3What is jMusicMetaManager?
- a tool for improving metadata associated with
recordings by automatically detecting
inconsistencies and redundancies.
(McKay et al. 2006)
4What is MusicBrainz?
- MusicBrainz is a user-maintained community music
metadatabase.
http//musicbrainz.org/doc/AboutMusicBrainz
5Some Programming Definitions
- Object-Oriented ProgrammingProgramming
paradigmObjects Classes Shapes example - GUIGraphical User Interface
- StringSequence of characters
- Hash tableArray of values accessed with a key
6ID3v1 vs ID3v2
- ID3v1
- 30 bytes max per field
- Metadata is at the end of the file
- ID3v1.1 add 60 bytes to title, artist, album
- (ID3v1.2 comment 30?43 bytes)
- ID3v2
- Use Frames (hash table) of max total size 256MB!
- Internationalization different character sets
- Metadata is at the start of the file ? streaming
- ID3v2.1, ID3v2.2, ID3v2.3
- ID3v2.4 not widely supported
7From 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 Chapter Tool, Jaikoz, etc.
8Code Sections of Interest
- ID3 library change ? Metadata abstraction
- Class RecordingMetaDatapublic
RecordingMetaData(File mp3_file) - Reporting choices
- Class AnalysisPreferenceshandle GUI selections
- Report generation
- Class AnalysisProcessornew method
reportMusicBrainz() - MusicBrainz querying
- Class MusicBrainzProcessor
- GUI
9MusicBrainzProcessor Class
Uses libmusicbrainz-java library (revision 12315)
for querying
10reportMusicBrainz()
- Iterate through all parsed files
- Fetch artist name
- Fetch album name (using artist name)
- Fetch title (using artist and album names)
11GUI Changes
12GUI Changes
13Sample Report
In browser
14Improvements
- More files can now be read by the software!
- Simplest report, full personal library (all MP3,
no iTunes XML) - Previously read only 6 985/10 377 67 of ID3
tags (mostly because of ID3v2 revision gt 0) - Now reads 9 892 / 10 377 95 of ID3 tags
- Character set when reading year ? can be fixed
- ID3 tag exception ? to investigate
- Basic MusicBrainz support so far
15//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
16Current 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
17Current 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 queries take a minimum of 2 h 53 min
18References
- 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. 1603.
Links
Dan ONeill. 2009. Home ID3.org.
http//www.id3.org/ (accessed 26 November
2009) Cory McKay. 2006. jMusicMetaManager.
http//jmir.sourceforge.net/manuals/jMusicMetaMana
ger_manual/Manual.html (accessed 26 November
2009) Eric Farng. 2005. Java ID3 Tag Library.
http//javamusictag.sourceforge.net/ (accessed 26
November 2009)