Fields Summary |
---|
public static final String[] | CODEC_DESCRIPTIONSStores the hex values of codec identifiers to their descriptions.
|
public static final long | WMAStores the audio codec number for WMA |
public static final long | WMA_CBRStores the audio codec number for WMA (CBR) |
public static final long | WMA_LOSSLESSStores the audio codec number for WMA_LOSSLESS |
public static final long | WMA_PROStores the audio codec number for WMA_PRO |
public static final long | WMA_VBRStores the audio codec number for WMA (VBR) |
private long | averageBytesPerSecStores the average amount of bytes used by audio stream.
This value is a field within type specific data of audio stream. Maybe it
could be used to calculate the KBPs. |
private int | bitsPerSampleAmount of bits used per sample.
|
private long | blockAlignmentThe block alignment of the audio data. |
private long | channelCountNumber of channels. |
private byte[] | codecDataSome data which needs to be interpreted if the codec is handled. |
private long | compressionFormatThe audio compression format code. |
private GUID | errorConcealmentthis field stores the error concealment type. |
private long | samplingRateSampling rate of audio stream. |
Methods Summary |
---|
public long | getAverageBytesPerSec()
return this.averageBytesPerSec;
|
public int | getBitsPerSample()
return this.bitsPerSample;
|
public long | getBlockAlignment()
return this.blockAlignment;
|
public long | getChannelCount()
return this.channelCount;
|
public byte[] | getCodecData()
return this.codecData.clone();
|
public java.lang.String | getCodecDescription()This method will take a look at {@link #compressionFormat}and returns a
String with its hex value and if known a textual note on what coded it
represents.
final StringBuilder result = new StringBuilder(Long
.toHexString(getCompressionFormat()));
String furtherDesc = " (Unknown)";
for (final String[] aCODEC_DESCRIPTIONS : CODEC_DESCRIPTIONS) {
if (aCODEC_DESCRIPTIONS[0].equalsIgnoreCase(result.toString())) {
furtherDesc = aCODEC_DESCRIPTIONS[1];
break;
}
}
if (result.length() % 2 == 0) {
result.insert(0, "0x");
} else {
result.insert(0, "0x0");
}
result.append(furtherDesc);
return result.toString();
|
public long | getCompressionFormat()
return this.compressionFormat;
|
public GUID | getErrorConcealment()
return this.errorConcealment;
|
public int | getKbps()This method takes the value of {@link #getAverageBytesPerSec()}and
calculates the kbps out of it, by simply multiplying by 8 and dividing by
1000.
return (int) getAverageBytesPerSec() * 8 / 1000;
|
public long | getSamplingRate()
return this.samplingRate;
|
public boolean | isErrorConcealed()This mehtod returns whether the audio stream data is error concealed.
For now only interleaved concealment is known.
return getErrorConcealment().equals(
GUID.GUID_AUDIO_ERROR_CONCEALEMENT_INTERLEAVED);
|
public java.lang.String | prettyPrint(java.lang.String prefix){@inheritDoc}
final StringBuilder result = new StringBuilder(super.prettyPrint(prefix));
result.append(prefix).append(" |-> Audio info:").append(
Utils.LINE_SEPARATOR);
result.append(prefix).append(" | : Bitrate : ").append(getKbps())
.append(Utils.LINE_SEPARATOR);
result.append(prefix).append(" | : Channels : ").append(
getChannelCount()).append(" at ").append(getSamplingRate())
.append(" Hz").append(Utils.LINE_SEPARATOR);
result.append(prefix).append(" | : Bits per Sample: ").append(
getBitsPerSample()).append(Utils.LINE_SEPARATOR);
result.append(prefix).append(" | : Formatcode: ").append(
getCodecDescription()).append(Utils.LINE_SEPARATOR);
return result.toString();
|
public void | setAverageBytesPerSec(long avgeBytesPerSec)
this.averageBytesPerSec = avgeBytesPerSec;
|
public void | setBitsPerSample(int bps)Sets the bitsPerSample
this.bitsPerSample = bps;
|
public void | setBlockAlignment(long align)Sets the blockAlignment.
this.blockAlignment = align;
|
public void | setChannelCount(long channels)
this.channelCount = channels;
|
public void | setCodecData(byte[] codecSpecificData)Sets the codecData
if (codecSpecificData == null) {
throw new IllegalArgumentException();
}
this.codecData = codecSpecificData.clone();
|
public void | setCompressionFormat(long cFormatCode)
this.compressionFormat = cFormatCode;
|
public void | setErrorConcealment(GUID errConc)This method sets the error concealment type which is given by two GUIDs.
this.errorConcealment = errConc;
|
public void | setSamplingRate(long sampRate)
this.samplingRate = sampRate;
|