public class GenericAudioHeader extends Object implements AudioHeader
Constructor and Description |
---|
GenericAudioHeader()
Creates an instance with emtpy values.
|
Modifier and Type | Method and Description |
---|---|
Long |
getAudioDataEndPosition() |
Long |
getAudioDataLength() |
Long |
getAudioDataStartPosition() |
String |
getBitRate() |
long |
getBitRateAsNumber()
This method returns the bitRate of the represented audio clip in
"Kbps".
|
int |
getBitsPerSample() |
Integer |
getByteRate() |
int |
getChannelNumber()
This method returns the number of audio channels the clip contains.
(The stereo, mono thing). |
String |
getChannels() |
String |
getEncodingType()
Returns the encoding type.
|
String |
getFormat()
Returns the format, same as encoding type
|
Long |
getNoOfSamples() |
double |
getPreciseTrackLength()
This method returns the duration of the represented audio clip in seconds
(single-precision).
|
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 |
setAudioDataEndPosition(Long audioDataEndPosition) |
void |
setAudioDataLength(long audioDataLength) |
void |
setAudioDataStartPosition(Long audioDataStartPosition) |
void |
setBitRate(int bitRate)
This Method sets the bitRate in "Kbps".
|
void |
setBitsPerSample(int bitsPerSample) |
void |
setByteRate(int byteRate) |
void |
setChannelNumber(int channelMode)
Sets the number of channels.
|
void |
setEncodingType(String encodingType)
Sets the type of the encoding.
This is a bit format specific. eg:Layer I/II/III |
void |
setFormat(String format)
Sets the type of the encoding.
This is the generic encoding format, e.g mp3, Flac, Aac, AppleLossless |
void |
setLossless(boolean isLossless)
Sets the Lossless flag for the represented audio clip.
|
void |
setNoOfSamples(Long noOfSamples) |
void |
setPreciseLength(double length)
This method sets the audio duration of the represented clip.
|
void |
setSamplingRate(int samplingRate)
Sets the Sampling rate in "Hz"
|
void |
setVariableBitRate(boolean isVbr)
Sets the VBR flag for the represented audio clip.
|
String |
toString()
Pretty prints this encoding info
|
public GenericAudioHeader()
public String getBitRate()
getBitRate
in interface AudioHeader
public long getBitRateAsNumber()
getBitRateAsNumber
in interface AudioHeader
public int getChannelNumber()
public String getChannels()
getChannels
in interface AudioHeader
public String getEncodingType()
getEncodingType
in interface AudioHeader
public String getFormat()
getFormat
in interface AudioHeader
public int getTrackLength()
getTrackLength
in interface AudioHeader
getPreciseTrackLength()
public double getPreciseTrackLength()
getPreciseTrackLength
in interface AudioHeader
getTrackLength()
public String getSampleRate()
getSampleRate
in interface AudioHeader
public int getSampleRateAsNumber()
getSampleRateAsNumber
in interface AudioHeader
public int getBitsPerSample()
getBitsPerSample
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".isLossless
in interface AudioHeader
true
if audio clip is encoded with VBR.public void setBitRate(int bitRate)
bitRate
- bitRate in kbps.public void setChannelNumber(int channelMode)
channelMode
- number of channels (2 for stereo, 1 for mono).public void setEncodingType(String encodingType)
encodingType
- Encoding type.public void setFormat(String format)
format
- Format.public void setPreciseLength(double length)
length
- The duration of the audio in seconds (single-precision).public void setSamplingRate(int samplingRate)
samplingRate
- Sample rate.public void setBitsPerSample(int bitsPerSample)
public void setByteRate(int byteRate)
public void setVariableBitRate(boolean isVbr)
isVbr
- true
if VBR.public void setLossless(boolean isLossless)
isLossless
- true
if Lossless.public String toString()
toString
in class Object
Object.toString()
public Long getAudioDataLength()
getAudioDataLength
in interface AudioHeader
public void setAudioDataLength(long audioDataLength)
public Integer getByteRate()
getByteRate
in interface AudioHeader
public Long getNoOfSamples()
getNoOfSamples
in interface AudioHeader
public void setNoOfSamples(Long noOfSamples)
public Long getAudioDataStartPosition()
getAudioDataStartPosition
in interface AudioHeader
public void setAudioDataStartPosition(Long audioDataStartPosition)
public Long getAudioDataEndPosition()
getAudioDataEndPosition
in interface AudioHeader
public void setAudioDataEndPosition(Long audioDataEndPosition)
Copyright © 2005–2020 jthink.net. All rights reserved.