|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.cs.ohtu.mpeg2.audio.mpa.MP123Header
public class MP123Header
Represents an MPEG-1 audio frame header as described in the section 2.4.1.2 of ISO/IEC 11172-3.
Nested Class Summary | |
---|---|
static class |
MP123Header.Layer
Represents the MPEG-1 audio layer. |
static class |
MP123Header.ModeExtension
Represents the mode extension. |
Field Summary | |
---|---|
private int |
bitrate
|
private boolean |
copyrighted
|
private boolean |
crcProtected
|
private boolean |
isMpeg2
|
private MP123Header.Layer |
layer
|
private AudioEncoder.Mode |
mode
|
private MP123Header.ModeExtension |
modeExt
|
private boolean |
original
|
private boolean |
padding
|
private AudioEncoder.SampleRate |
srate
|
Constructor Summary | |
---|---|
MP123Header()
Creates a new MP123Header instance with
default values. |
|
MP123Header(MP123Header.Layer layer,
AudioEncoder.Mode mode,
AudioEncoder.SampleRate srate,
int bitrate)
Creates a new MP123Header instance with
given parameters. |
Method Summary | |
---|---|
int |
getBitrate()
Returns the bitrate. |
MP123Header.Layer |
getLayer()
Returns the layer. |
AudioEncoder.Mode |
getMode()
Returns the mode. |
MP123Header.ModeExtension |
getModeExtension()
Returns the mode extension. |
AudioEncoder.SampleRate |
getSampleRate()
Returns the sample rate. |
boolean |
isCopyrighted()
Returns wheter the audio is copyrighted. |
boolean |
isCRCProtected()
Returns whether the CRC protection is on. |
boolean |
isOriginal()
Returns whether the audio is an original. |
boolean |
isPadded()
Returns whether the padding flag is set. |
void |
setBitrate(int bitrate)
Sets the bitrate. |
void |
setCopyrighted(boolean copyrighted)
Sets whether the audio is copyrighted. |
void |
setCRCProtection(boolean crcProtected)
Sets whether the CRC protection is on. |
void |
setLayer(MP123Header.Layer layer)
Sets the layer. |
void |
setMode(AudioEncoder.Mode mode)
Sets the mode. |
void |
setModeExtension(MP123Header.ModeExtension modeExt)
Sets the mode extension. |
void |
setOriginal(boolean original)
Sets whether the audio is original. |
void |
setPadding(boolean padding)
Sets whether the padding is on. |
void |
setSampleRate(AudioEncoder.SampleRate srate)
Sets the sample rate. |
void |
writeTo(BitOutputStream stream)
Writes the header to the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private MP123Header.Layer layer
private AudioEncoder.Mode mode
private MP123Header.ModeExtension modeExt
private AudioEncoder.SampleRate srate
private boolean crcProtected
private boolean padding
private boolean copyrighted
private boolean original
private boolean isMpeg2
private int bitrate
Constructor Detail |
---|
public MP123Header()
MP123Header
instance with
default values.
The defaults: the layer is Layer.LAYER_1
,
the mode is Mode.SINGLE_CHANNEL
, the sample rate is
SampleRate.SRATE_48000, the bitrate is 128kbit/s,
CRC protection is off, padding is off, not original,
not copyrighted.
public MP123Header(MP123Header.Layer layer, AudioEncoder.Mode mode, AudioEncoder.SampleRate srate, int bitrate)
MP123Header
instance with
given parameters.
layer
- MPEG-1 audio layermode
- the modesrate
- the sampling ratebitrate
- the bitrateMethod Detail |
---|
public boolean isCRCProtected()
true
iff the CRC protection is onpublic boolean isPadded()
true
iff the padding flag is setpublic boolean isOriginal()
true
iff the audio is originalpublic boolean isCopyrighted()
true
iff the audio is copyrightedpublic AudioEncoder.Mode getMode()
public MP123Header.ModeExtension getModeExtension()
public MP123Header.Layer getLayer()
public AudioEncoder.SampleRate getSampleRate()
public int getBitrate()
public void setBitrate(int bitrate)
bitrate
- the bitratepublic void setMode(AudioEncoder.Mode mode)
mode
- the modepublic void setModeExtension(MP123Header.ModeExtension modeExt)
modeExt
- the mode extensionpublic void setLayer(MP123Header.Layer layer)
layer
- the layerpublic void setSampleRate(AudioEncoder.SampleRate srate)
srate
- the sample ratepublic void setPadding(boolean padding)
padding
- if true
, the padding is set on;
otherwise it is set offpublic void setCRCProtection(boolean crcProtected)
crcProtected
- if true, the CRC protection
is set on; otherwise it is set offpublic void setOriginal(boolean original)
original
- if true
, the audio is original;
otherwise it is notpublic void setCopyrighted(boolean copyrighted)
copyrighted
- if true
, the audio is copyrighted;
otherwise it is notpublic void writeTo(BitOutputStream stream) throws java.io.IOException
stream
- the stream to write this header to
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |