uk.org.retep.util.io
Class MP3

java.lang.Object
  extended by uk.org.retep.util.io.MP3
All Implemented Interfaces:
java.io.Serializable

public class MP3
extends java.lang.Object
implements java.io.Serializable

This class reads in the TAG's contained within an MP3 audio files header. This could then be used to populate a database with your MP3 collection.

Version:
1.0
Author:
Peter T Mount
See Also:
Serialized Form

Field Summary
static java.lang.String ALBUM
          Tag name containing the album name
static java.lang.String BIO
          This is unique to MusicMatch.
static java.lang.String GENRE
          The Genre
static java.lang.String LENGTH
          The track length in bytes
static java.lang.String LYRICS
          The Lyrics for this track
static java.lang.String MED
          Tag name containing the source media
static java.lang.String MOOD
          This is unique to MusicMatch.
static java.lang.String NOTES
          This is unique to MusicMatch? Notes
static java.lang.String SITUATION
          This is unique to MusicMatch.
static java.lang.String TEMPO
          This is unique to MusicMatch.
static java.lang.String TITLE
          The title of this track
static java.lang.String TRACK
          The track number (ie 01-99 for tracks on a cd)
static java.lang.String URL_ARTIST
          The URL for the artist
static java.lang.String URL_AUDIO
          The URL for audio?
static java.lang.String URL_BUYCD
          The URL to buy the cd
static java.lang.String YEAR
          Tag name containing the year the track was produced
 
Constructor Summary
MP3()
          Empty Constructor.
MP3(java.io.File aFile)
          Construct and read data in from a file
MP3(java.io.RandomAccessFile raf)
          Construct and read data in from a file
 
Method Summary
 java.lang.String get(java.lang.String tag)
           
 java.util.Iterator getTags()
          Obtains an Iterator of tag names in the MP3 file.
static void main(java.lang.String[] args)
          A simple example application.
 void read(java.io.File aFile)
          Read data in from a file
 void read(java.io.RandomAccessFile raf)
          Read data in from a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YEAR

public static final java.lang.String YEAR
Tag name containing the year the track was produced

See Also:
Constant Field Values

ALBUM

public static final java.lang.String ALBUM
Tag name containing the album name

See Also:
Constant Field Values

MED

public static final java.lang.String MED
Tag name containing the source media

See Also:
Constant Field Values

TRACK

public static final java.lang.String TRACK
The track number (ie 01-99 for tracks on a cd)

See Also:
Constant Field Values

LENGTH

public static final java.lang.String LENGTH
The track length in bytes

See Also:
Constant Field Values

URL_ARTIST

public static final java.lang.String URL_ARTIST
The URL for the artist

See Also:
Constant Field Values

URL_BUYCD

public static final java.lang.String URL_BUYCD
The URL to buy the cd

See Also:
Constant Field Values

URL_AUDIO

public static final java.lang.String URL_AUDIO
The URL for audio?

See Also:
Constant Field Values

TITLE

public static final java.lang.String TITLE
The title of this track

See Also:
Constant Field Values

LYRICS

public static final java.lang.String LYRICS
The Lyrics for this track

See Also:
Constant Field Values

GENRE

public static final java.lang.String GENRE
The Genre

See Also:
Constant Field Values

SITUATION

public static final java.lang.String SITUATION
This is unique to MusicMatch. The Situation (ie Dance, Romantic etc)

See Also:
Constant Field Values

TEMPO

public static final java.lang.String TEMPO
This is unique to MusicMatch. The Tempo

See Also:
Constant Field Values

NOTES

public static final java.lang.String NOTES
This is unique to MusicMatch? Notes

See Also:
Constant Field Values

MOOD

public static final java.lang.String MOOD
This is unique to MusicMatch. The Mood.

See Also:
Constant Field Values

BIO

public static final java.lang.String BIO
This is unique to MusicMatch. The Biography

See Also:
Constant Field Values
Constructor Detail

MP3

public MP3()
Empty Constructor. Does nothing inparticular.


MP3

public MP3(java.io.File aFile)
    throws java.io.IOException
Construct and read data in from a file

Parameters:
aFile - File pointing to an MP3 file
Throws:
java.io.IOException

MP3

public MP3(java.io.RandomAccessFile raf)
    throws java.io.IOException
Construct and read data in from a file

Parameters:
raf - RandomAccessFile pointing to an MP3 file
Throws:
java.io.IOException
Method Detail

get

public java.lang.String get(java.lang.String tag)
Parameters:
tag - A tag name from within the MP3 file
Returns:
the value of that tag, null if not present.

getTags

public java.util.Iterator getTags()
Obtains an Iterator of tag names in the MP3 file.

Returns:
Iterator

read

public void read(java.io.File aFile)
          throws java.io.IOException
Read data in from a file

Parameters:
aFile - File pointing to an MP3 file
Throws:
java.io.IOException

read

public void read(java.io.RandomAccessFile raf)
          throws java.io.IOException
Read data in from a file

Parameters:
raf - RandomAccessFile pointing to an MP3 file
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
A simple example application. This reads all mp3 files given on the command line, and writes their TAG's to System.out.

Parameters:
args -
Throws:
java.lang.Exception


Copyright © 1998-2010 Retep Development Group. All Rights Reserved.