Fields Summary |
---|
public static final String | FIELD_BITRATEThe key for the Bitrate.({@link Integer})
|
public static final String | FIELD_CHANNELThe key for the number of audio channels.({@link Integer})
|
public static final String | FIELD_INFOSThe key for the extra encoding information.({@link String})
|
public static final String | FIELD_LENGTHThe key for the audio clip duration in seconds. ({@link Float})
|
public static final String | FIELD_SAMPLERATEThe key for the audio sample rate in "Hz". ({@link Integer})
|
public static final String | FIELD_TYPEThe key for the audio type.({@link String})
|
public static final String | FIELD_VBRThe key for the VBR flag. ({@link Boolean})
|
private boolean | isLosslessUsed for WMA files |
protected HashMap | contentThis table containts the parameters.
|
Methods Summary |
---|
public java.lang.String | getBitRate()
return content.get(FIELD_BITRATE).toString();
|
public long | getBitRateAsNumber()This method returns the bitrate of the represented audio clip in
"Kbps".
return ((Integer) content.get(FIELD_BITRATE)).longValue();
|
public int | getChannelNumber()This method returns the number of audio channels the clip contains.
(The stereo, mono thing).
return (Integer) content.get(FIELD_CHANNEL);
|
public java.lang.String | getChannels()
return String.valueOf(getChannelNumber());
|
public java.lang.String | getEncodingType()Returns the encoding type.
return (String) content.get(FIELD_TYPE);
|
public java.lang.String | getExtraEncodingInfos()This method returns some extra information about the encoding.
This may not contain anything for some audio formats.
return (String) content.get(FIELD_INFOS);
|
public java.lang.String | getFormat()Returns the format, same as encoding type
return (String) content.get(FIELD_TYPE);
|
public float | getPreciseLength()This method returns the duration of the represented audio clip in seconds
(single-precision).
return (Float) content.get(FIELD_LENGTH);
|
public java.lang.String | getSampleRate()This method returns the sample rate, the audio clip was encoded with.
return content.get(FIELD_SAMPLERATE).toString();
|
public int | getSampleRateAsNumber()
return (Integer) content.get(FIELD_SAMPLERATE);
|
public int | getTrackLength()This method returns the duration of the represented audio clip in
seconds.
return (int) getPreciseLength();
|
public boolean | isLossless()This method returns true , if the audio file is encoded
with "Lossless".
return isLossless;
|
public boolean | isVariableBitRate()This method returns true , if the audio file is encoded
with "Variable Bitrate".
return (Boolean) content.get(FIELD_VBR);
|
public void | setBitrate(int bitrate)This Method sets the bitrate in "Kbps".
content.put(FIELD_BITRATE, bitrate);
|
public void | setChannelNumber(int chanNb)Sets the number of channels.
content.put(FIELD_CHANNEL, chanNb);
|
public void | setEncodingType(java.lang.String encodingType)Sets the type of the encoding.
This is a bit format specific.
eg:Layer I/II/III
content.put(FIELD_TYPE, encodingType);
|
public void | setExtra(java.lang.String key, java.lang.Object value)Can be used to add additional information
content.put(key, value);
|
public void | setExtraEncodingInfos(java.lang.String infos)A string containing anything else that might be interesting
content.put(FIELD_INFOS, infos);
|
public void | setLength(int length)This method sets the audio duration of the represented clip.
content.put(FIELD_LENGTH, (float) length);
|
public void | setLossless(boolean b)Sets the Lossless flag for the represented audio clip.
isLossless = b;
|
public void | setPreciseLength(float seconds)This method sets the audio duration of the represented clip.
content.put(FIELD_LENGTH, seconds);
|
public void | setSamplingRate(int samplingRate)Sets the Sampling rate in "Hz"
content.put(FIELD_SAMPLERATE, samplingRate);
|
public void | setVariableBitRate(boolean b)Sets the VBR flag for the represented audio clip.
content.put(FIELD_VBR, b);
|
public java.lang.String | toString()Pretty prints this encoding info
StringBuffer out = new StringBuffer(50);
out.append("Encoding infos content:\n");
Set<String> set = content.keySet();
for (String key : set)
{
Object val = content.get(key);
out.append("\t");
out.append(key);
out.append(" : ");
out.append(val);
out.append("\n");
}
return out.toString().substring(0, out.length() - 1);
|