|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.audio.generic.GenericAudioHeader
public class GenericAudioHeader
This class represents a structure for storing and retrieving information
about the codec respectively the encoding parameters.
Most of the parameters are available for nearly each audio format. Some
others would result in standard values.
Consider: None of the setter methods will actually affect the audio
file. This is just a structure for retrieving information, not manipulating
the audio file.
Field Summary | |
---|---|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
content
This table containts the parameters. |
static java.lang.String |
FIELD_BITRATE
The key for the Bitrate.( Integer ) |
static java.lang.String |
FIELD_CHANNEL
The key for the number of audio channels.( Integer ) |
static java.lang.String |
FIELD_INFOS
The key for the extra encoding information.( String ) |
static java.lang.String |
FIELD_LENGTH
The key for the audio clip duration in seconds. |
static java.lang.String |
FIELD_SAMPLERATE
The key for the audio sample rate in "Hz". |
static java.lang.String |
FIELD_TYPE
The key for the audio type.( String ) |
static java.lang.String |
FIELD_VBR
The key for the VBR flag. |
private boolean |
isLossless
Used for WMA files |
Constructor Summary | |
---|---|
GenericAudioHeader()
Creates an instance with emtpy values. |
Method Summary | |
---|---|
java.lang.String |
getBitRate()
|
long |
getBitRateAsNumber()
This method returns the bitrate of the represented audio clip in "Kbps". |
int |
getChannelNumber()
This method returns the number of audio channels the clip contains. (The stereo, mono thing). |
java.lang.String |
getChannels()
|
java.lang.String |
getEncodingType()
Returns the encoding type. |
java.lang.String |
getExtraEncodingInfos()
This method returns some extra information about the encoding. This may not contain anything for some audio formats. |
java.lang.String |
getFormat()
Returns the format, same as encoding type |
float |
getPreciseLength()
This method returns the duration of the represented audio clip in seconds (single-precision). |
java.lang.String |
getSampleRate()
This method returns the sample rate, the audio clip was encoded with. |
int |
getSampleRateAsNumber()
|
int |
getTrackLength()
This method returns the duration of the represented audio clip in seconds. |
boolean |
isLossless()
This method returns true , if the audio file is encoded
with "Lossless". |
boolean |
isVariableBitRate()
This method returns true , if the audio file is encoded
with "Variable Bitrate". |
void |
setBitrate(int bitrate)
This Method sets the bitrate in "Kbps". |
void |
setChannelNumber(int chanNb)
Sets the number of channels. |
void |
setEncodingType(java.lang.String encodingType)
Sets the type of the encoding. This is a bit format specific. eg:Layer I/II/III |
void |
setExtra(java.lang.String key,
java.lang.Object value)
Can be used to add additional information |
void |
setExtraEncodingInfos(java.lang.String infos)
A string containing anything else that might be interesting |
void |
setLength(int length)
This method sets the audio duration of the represented clip. |
void |
setLossless(boolean b)
Sets the Lossless flag for the represented audio clip. |
void |
setPreciseLength(float seconds)
This method sets the audio duration of the represented clip. |
void |
setSamplingRate(int samplingRate)
Sets the Sampling rate in "Hz" |
void |
setVariableBitRate(boolean b)
Sets the VBR flag for the represented audio clip. |
java.lang.String |
toString()
Pretty prints this encoding info |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FIELD_BITRATE
Integer
)
content
,
Constant Field Valuespublic static final java.lang.String FIELD_CHANNEL
Integer
)
content
,
Constant Field Valuespublic static final java.lang.String FIELD_INFOS
String
)
content
,
Constant Field Valuespublic static final java.lang.String FIELD_LENGTH
Float
)
content
,
Constant Field Valuespublic static final java.lang.String FIELD_SAMPLERATE
Integer
)
content
,
Constant Field Valuespublic static final java.lang.String FIELD_TYPE
String
)
content
,
Constant Field Valuespublic static final java.lang.String FIELD_VBR
Boolean
)
content
,
Constant Field Valuesprivate boolean isLossless
protected java.util.HashMap<java.lang.String,java.lang.Object> content
Constructor Detail |
---|
public GenericAudioHeader()
Method Detail |
---|
public java.lang.String getBitRate()
getBitRate
in interface AudioHeader
public long getBitRateAsNumber()
getBitRateAsNumber
in interface AudioHeader
public int getChannelNumber()
public java.lang.String getChannels()
getChannels
in interface AudioHeader
public java.lang.String getEncodingType()
getEncodingType
in interface AudioHeader
public java.lang.String getFormat()
getFormat
in interface AudioHeader
public java.lang.String getExtraEncodingInfos()
public int getTrackLength()
getTrackLength
in interface AudioHeader
getPreciseLength()
public float getPreciseLength()
getTrackLength()
public java.lang.String getSampleRate()
getSampleRate
in interface AudioHeader
public int getSampleRateAsNumber()
getSampleRateAsNumber
in interface AudioHeader
public boolean isVariableBitRate()
true
, if the audio file is encoded
with "Variable Bitrate".
isVariableBitRate
in interface AudioHeader
true
if audio clip is encoded with VBR.public boolean isLossless()
true
, if the audio file is encoded
with "Lossless".
true
if audio clip is encoded with VBR.public void setBitrate(int bitrate)
bitrate
- bitrate in kbps.public void setChannelNumber(int chanNb)
chanNb
- number of channels (2 for stereo, 1 for mono).public void setEncodingType(java.lang.String encodingType)
encodingType
- Encoding type.public void setExtraEncodingInfos(java.lang.String infos)
infos
- Extra information.public void setLength(int length)
length
- The duration of the audio clip in seconds.public void setPreciseLength(float seconds)
seconds
- The duration of the audio clip in seconds (single-precision).public void setSamplingRate(int samplingRate)
samplingRate
- Sample rate.public void setVariableBitRate(boolean b)
b
- true
if VBR.public void setLossless(boolean b)
b
- true
if Lossless.public void setExtra(java.lang.String key, java.lang.Object value)
key
- value
- public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |