public class MP3Decoder extends Object
Decoder class encapsulates the details of decoding an MPEG audio frame.| Modifier and Type | Field and Description |
|---|---|
static int |
DECODER_ERROR
The first decoder error code.
|
static int |
ILLEGAL_SUBBAND_ALLOCATION
Illegal allocation in subband layer.
|
static int |
UNKNOWN_ERROR |
static int |
UNSUPPORTED_LAYER
Layer not supported by the decoder.
|
| Constructor and Description |
|---|
MP3Decoder()
Creates a new
Decoder instance with default parameters. |
| Modifier and Type | Method and Description |
|---|---|
OutputBuffer |
decodeFrame(Header header,
Bitstream stream)
Decodes one frame from an MPEG audio bitstream.
|
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,
Throwable throwable) |
protected FrameDecoder |
retrieveDecoder(Header header,
Bitstream stream,
int layer) |
void |
setOutputBuffer(OutputBuffer out)
Changes the output buffer.
|
public static final int DECODER_ERROR
DecoderErrors interface for other decoder error codes.public static final int UNKNOWN_ERROR
public static final int UNSUPPORTED_LAYER
public static final int ILLEGAL_SUBBAND_ALLOCATION
public MP3Decoder()
Decoder instance with default parameters.public OutputBuffer 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.DecoderExceptionpublic void setOutputBuffer(OutputBuffer out)
public int getOutputFrequency()
the - sample rate (in Hz) of the samples written to the output buffer when decoding.public int getOutputChannels()
protected DecoderException newDecoderException(int errorcode)
protected DecoderException newDecoderException(int errorcode, Throwable throwable)
protected FrameDecoder retrieveDecoder(Header header, Bitstream stream, int layer) throws DecoderException
DecoderExceptionCopyright © 2013. All Rights Reserved.