public class MP3FileID3Controller extends Object
| Constructor and Description |
|---|
MP3FileID3Controller(RandomAccessInputStream raf) |
MP3FileID3Controller(URL mp3URL) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAlbum(int type)
Returns the album of the mp3 if set and the empty string if not.
|
String |
getAlbumArtist()
Returns the album artist of this mp3 if set and the empty string
if not (id3v2 only).
|
String |
getArtist(int type)
Returns the artist of the mp3 if set and the empty string if not.
|
int |
getBitRate()
Returns the bit rate of this mp3 in kbps.
|
String |
getBPM()
Returns the BPM of this song
(id3v2 only).
|
String |
getComment(int type)
Returns the comment field of this mp3 if set and the empty string if
not.
|
String |
getComposer()
Returns the composer of this mp3 if set and the empty string if not
(id3v2 only).
|
String |
getCopyrightInfo()
Returns the copyright info of this mp3 if set and the empty string
if not (id3v2 only).
|
String |
getDisc()
Returns the number of CD this song is on
(id3v2 only).
|
String |
getEncodedBy()
Returns who encoded this mp3 if set and the empty string if not
(id3v2 only).
|
String |
getFileName()
returns the full path of this mp3 file
|
byte[] |
getFrameDataBytes(String id)
Returns the data contained in the frame specified by the id (id3v2 only)
.
|
String |
getFrameDataString(String id)
Returns the textual information contained in the frame specifed by the
id.
|
String |
getGenre(int type)
Returns the genre of this mp3 if set and the empty string if not.
|
String |
getMPEGChannelMode()
Return the channel mode of the mpeg.
|
String |
getMPEGEmphasis()
Returns the emphasis of this mp3.
|
String |
getMPEGLayer()
Returns a string specifying the layer of the mpeg.
|
String |
getMPEGVersion()
Returns a string specifying the version of the mpeg.
|
String |
getOriginalArtist()
Returns the original artist of this mp3 if set and the empty string
if not (id3v2 only).
|
long |
getPlayingTime()
Returns the length (in seconds) of the playing time of this mp3.
|
String |
getPlayingTimeString()
Return a formatted version of the getPlayingTime method.
|
String |
getPublisher()
Returns the original artist of this mp3 if set and the empty string
if not (id3v2 only).
|
int |
getSampleRate()
Returns the sample rate of this mp3 in Hz.
|
String |
getShortDescription()
A short description like winamp does in its default
|
String |
getTitle(int type)
Returns the title of this mp3 if set and the empty string if not.
|
String |
getTrack(int type)
Returns the track of this mp3 if set and the empty string if not.
|
String |
getUserDefinedURL()
Returns the user defined url of this mp3 if set and the empty string
if not (id3v2 only).
|
String |
getYear(int type)
Returns the year of this mp3 if set and the empty string if not.
|
boolean |
id3v1Exists()
Returns true if an id3v1 tag currently exists.
|
boolean |
id3v2Exists()
Returns true if an id3v2 tag currently exists.
|
boolean |
isMP3()
Returns true if this file is an mp3.
|
boolean |
isMPEGCopyrighted()
Returns true if this mpeg is copyrighted.
|
boolean |
isMPEGOriginal()
Returns true if this mpeg is the original.
|
boolean |
isMPEGProtected()
Returns true if this mpeg is protected by CRC.
|
void |
removeTags(int type)
Removes id3 tags from the file.
|
void |
setAlbum(String album,
int type)
Set the album of this mp3.
|
void |
setArtist(String artist,
int type)
Set the artist of this mp3.
|
void |
setComment(String comment,
int type)
Add a comment to this mp3.
|
void |
setComposer(String composer)
Set the composer of this mp3 (id3v2 only).
|
void |
setCopyrightInfo(String copyright)
Add some copyright information to this mp3 (id3v2 only).
|
void |
setEncodedBy(String encBy)
Set who encoded the mp3 (id3v2 only).
|
void |
setFrameData(String id,
byte[] data)
Set the data of the frame specified by the id (id3v2 only).
|
void |
setGenre(String genre,
int type)
Set the genre of this mp3.
|
void |
setOriginalArtist(String artist)
Set the original artist of this mp3 (id3v2 only).
|
void |
setTextFrame(String id,
String data)
Set the text of the text frame specified by the id (id3v2 only).
|
void |
setTitle(String title,
int type)
Set the title of this mp3.
|
void |
setTrack(int track,
int type)
Set the track number of this mp3.
|
void |
setUserDefinedText(String desc,
String text)
Add a field of miscellaneous text (id3v2 only).
|
void |
setUserDefinedURL(String desc,
String url)
Add a link to this mp3 (id3v2 only).
|
void |
setYear(String year,
int type)
Set the year of this mp3.
|
String |
toString()
Return a string representation of this object.
|
void |
writeTags()
Writes the current state of the id3 tags to the file.
|
public static final int ID3V1
public static final int ID3V2
public MP3FileID3Controller(URL mp3URL)
public MP3FileID3Controller(RandomAccessInputStream raf)
public void removeTags(int type)
throws FileNotFoundException,
IOException
type - specifies what tag(s) to removeFileNotFoundException - if an error occursIOException - if an error occurspublic void writeTags()
throws FileNotFoundException,
IOException
FileNotFoundException - if an error occursIOException - if an error occurspublic void setTitle(String title, int type)
title - the title of the mp3public void setAlbum(String album, int type)
album - the album of the mp3public void setArtist(String artist, int type)
artist - the artist of the mp3public void setComment(String comment, int type)
comment - a comment to add to the mp3public void setGenre(String genre, int type)
genre - the genre of the mp3public void setYear(String year, int type)
year - of the mp3public void setTrack(int track,
int type)
track - the track number of this mp3public void setComposer(String composer)
composer - the composer of this mp3public void setOriginalArtist(String artist)
artist - the original artist of this mp3public void setCopyrightInfo(String copyright)
copyright - copyright information related to this mp3public void setUserDefinedURL(String desc, String url)
desc - a description of the urlurl - the url itselfpublic void setUserDefinedText(String desc, String text)
desc - a description of the texttext - the text itselfpublic void setEncodedBy(String encBy)
encBy - who encoded the mp3public void setTextFrame(String id, String data)
id - the id of the frame to set the data fordata - the data to setpublic void setFrameData(String id, byte[] data)
id - the id of the frame to set the data fordata - the data to setpublic long getPlayingTime()
public String getPlayingTimeString()
public boolean id3v2Exists()
public boolean id3v1Exists()
public boolean isMP3()
public int getBitRate()
public int getSampleRate()
public String getMPEGEmphasis()
public String getMPEGLayer()
public String getMPEGVersion()
public String getMPEGChannelMode()
public boolean isMPEGCopyrighted()
public boolean isMPEGOriginal()
public boolean isMPEGProtected()
public String getArtist(int type)
ID3v2FormatException - if the data of the field is incorrectpublic String getAlbum(int type)
ID3v2FormatException - if the data of the field is incorrectpublic String getComment(int type)
ID3v2FormatException - if the data of the field is incorrectpublic String getGenre(int type)
ID3v2FormatException - if the data of this field is incorrectpublic String getTitle(int type)
ID3v2FormatException - if the data of this field is incorrectpublic String getTrack(int type)
ID3v2FormatException - if the data of this field is incorrectpublic String getYear(int type)
ID3v2FormatException - if the data of this field is incorrectpublic String getComposer()
ID3v2FormatException - if the data of this field is incorrectpublic String getDisc()
ID3v2FormatException - if the data of this field is incorrectpublic String getOriginalArtist()
ID3v2FormatException - if the data of this field is incorrectpublic String getAlbumArtist()
ID3v2FormatException - if the data of this field is incorrectpublic String getPublisher()
ID3v2FormatException - if the data of this field is incorrectpublic String getCopyrightInfo()
ID3v2FormatException - if the data of this field is incorrectpublic String getUserDefinedURL()
ID3v2FormatException - if the data of this field is incorrectpublic String getEncodedBy()
ID3v2FormatException - if the data of this field is incorrectpublic String getBPM()
ID3v2FormatException - if the data of this field is incorrectpublic String getFrameDataString(String id)
id - the id of the frame to get data fromID3v2FormatException - if the data of the frame is incorrectpublic byte[] getFrameDataBytes(String id)
id - the id of the frame to get data frompublic String getFileName()
public String getShortDescription()
Copyright © 2014. All rights reserved.