|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.File entagged.audioformats.AudioFile
public class AudioFile
This is the main object manipulated by the user representing an audiofile, its properties and its tag.
The prefered way to obtain an AudioFile
is to use the AudioFileIO.read(File)
method.
The AudioFile
contains every properties associated with the file itself (no meta-data), like the bitrate, the sampling rate, the encoding infos, etc.
To get the meta-data contained in this file you have to get the Tag
of this AudioFile
AudioFileIO
,
Tag
,
Serialized FormField Summary |
---|
Fields inherited from class java.io.File |
---|
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
---|---|
AudioFile(File f,
EncodingInfo info)
These constructors are used by the different readers, users should not use them, but use the AudioFileIO.read(File) method instead !. |
|
AudioFile(File f,
EncodingInfo info,
Tag tag)
These constructors are used by the different readers, users should not use them, but use the AudioFileIO.read(File) method instead !. |
Method Summary | |
---|---|
int |
getBitrate()
Returns the bitrate of this AufioFile in kilobytes per second (KB/s). |
int |
getChannelNumber()
Returns the number of audio channels contained in this AudioFile, 2 for example means stereo |
String |
getEncodingType()
Returns the encoding type of this AudioFile, this needs to be precisely specified in the future |
String |
getExtraEncodingInfos()
Returns the extra encoding infos of this AudioFile, this needs to be precisely specified in the future |
int |
getID()
|
int |
getLength()
Returns the length (duration) in seconds (s) of this AudioFile.Example: 241 seconds |
float |
getPreciseLength()
Returns the length (duration) in seconds with fractions. |
int |
getSamplingRate()
Returns the sampling rate of this AudioFile in Hertz (Hz). |
Tag |
getTag()
Returns the tag contained in this AudioFile, the Tag contains any useful meta-data, like artist, album, title, etc. |
boolean |
isVbr()
Checks if this file is a VBR (variable bitrate) or a Constant Bitrate one |
void |
setID(int id)
|
String |
toString()
Returns a multi-line string with the file path, the encoding informations, and the tag contents. |
Methods inherited from class java.io.File |
---|
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toURI, toURL |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AudioFile(File f, EncodingInfo info)
These constructors are used by the different readers, users should not use them, but use the AudioFileIO.read(File)
method instead !.
Create the AudioFile representing file f, the encodinginfos and containing an empty tag
f
- The file of the audiofileinfo
- the encoding infos over this filepublic AudioFile(File f, EncodingInfo info, Tag tag)
These constructors are used by the different readers, users should not use them, but use the AudioFileIO.read(File)
method instead !.
Create the AudioFile representing file f, the encodinginfos and containing the tag
f
- The file of the audiofileinfo
- the encoding infos over this filetag
- the tag contained in this fileMethod Detail |
---|
public int getBitrate()
Returns the bitrate of this AufioFile in kilobytes per second (KB/s). Example: 192 KB/s
public int getChannelNumber()
Returns the number of audio channels contained in this AudioFile, 2 for example means stereo
public String getEncodingType()
Returns the encoding type of this AudioFile, this needs to be precisely specified in the future
public String getExtraEncodingInfos()
Returns the extra encoding infos of this AudioFile, this needs to be precisely specified in the future
public int getLength()
Returns the length (duration) in seconds (s) of this AudioFile.Example: 241 seconds
public float getPreciseLength()
public int getSamplingRate()
Returns the sampling rate of this AudioFile in Hertz (Hz). Example: 44100 Hz for most of the audio files
public Tag getTag()
Returns the tag contained in this AudioFile, the Tag
contains any useful meta-data, like artist, album, title, etc.
If the file does not contain any tag, a new empty tag is returned
public boolean isVbr()
Checks if this file is a VBR (variable bitrate) or a Constant Bitrate one
True means VBR, false means CBR
This has only meaning with MP3 and MPC files, other formats are always VBR since it offers a better compression ratio (and lossless compression is by nature VBR
public String toString()
Returns a multi-line string with the file path, the encoding informations, and the tag contents.
toString
in class File
public void setID(int id)
id
- public int getID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |