public class Decoder extends java.lang.Object implements DecoderErrors
Decoder
class encapsulates the details of
decoding an MPEG audio frame.Modifier and Type | Class and Description |
---|---|
static class |
Decoder.Params
The
Params class presents the customizable
aspects of the decoder. |
ILLEGAL_SUBBAND_ALLOCATION, UNKNOWN_ERROR, UNSUPPORTED_LAYER
BITSTREAM_ERROR, DECODER_ERROR
Constructor and Description |
---|
Decoder()
Creates a new
Decoder instance with default
parameters. |
Decoder(Decoder.Params params0)
Creates a new
Decoder instance with default
parameters. |
Modifier and Type | Method and Description |
---|---|
Obuffer |
decodeFrame(Header header,
Bitstream stream)
Decodes one frame from an MPEG audio bitstream.
|
static Decoder.Params |
getDefaultParams() |
int |
getOutputBlockSize()
Retrieves the maximum number of samples that will be written to
the output buffer when one frame is decoded.
|
int |
getOutputChannels()
Retrieves the number of channels of PCM samples output by
this decoder.
|
int |
getOutputFrequency()
Retrieves the sample frequency of the PCM samples output
by this decoder.
|
protected DecoderException |
newDecoderException(int errorcode) |
protected DecoderException |
newDecoderException(int errorcode,
java.lang.Throwable throwable) |
protected FrameDecoder |
retrieveDecoder(Header header,
Bitstream stream,
int layer) |
void |
setEqualizer(Equalizer eq) |
void |
setOutputBuffer(Obuffer out)
Changes the output buffer.
|
public Decoder()
Decoder
instance with default
parameters.public Decoder(Decoder.Params params0)
Decoder
instance with default
parameters.params
- The Params
instance that describes
the customizable aspects of the decoder.public static Decoder.Params getDefaultParams()
public void setEqualizer(Equalizer eq)
public Obuffer decodeFrame(Header header, Bitstream stream) throws DecoderException
header
- The header describing the frame to decode.bitstream
- The bistream that provides the bits for te body of the frame.DecoderException
public void setOutputBuffer(Obuffer out)
public int getOutputFrequency()
the
- sample rate (in Hz) of the samples written to the
output buffer when decoding.public int getOutputChannels()
public int getOutputBlockSize()
protected DecoderException newDecoderException(int errorcode)
protected DecoderException newDecoderException(int errorcode, java.lang.Throwable throwable)
protected FrameDecoder retrieveDecoder(Header header, Bitstream stream, int layer) throws DecoderException
DecoderException