Decoder

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javazoom.jl.decoder
Class Decoder

    java.lang.Object
      javazoom.jl.decoder.Decoder

All Implemented Interfaces:
  DecoderErrors, JavaLayerErrors

public class Decoder
extends java.lang.Object
implements DecoderErrors

The `Decoder` class encapsulates the details of decoding an MPEG audio frame.

Since:
  0.0.5
Version:
  0.0.7 12/12/99

Nested Class Summary
`static class` | `Decoder.Params` The `Params` class presents the customizable aspects of the decoder.

Field Summary

Fields inherited from interface javazoom.jl.decoder.DecoderErrors
`UNKNOWN_ERROR, UNSUPPORTED_LAYER`

Fields inherited from interface javazoom.jl.decoder.JavaLayerErrors
`BITSTREAM_ERROR, DECODER_ERROR`

Constructor Summary
`Decoder()` Creates a new `Decoder` instance with default parameters.
`Decoder(Decoder.Params params0)` Creates a new `Decoder` instance with default parameters.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Decoder

    public Decoder()

  Creates a new `Decoder` instance with default parameters.

### Decoder

    public Decoder(Decoder.Params params0)

  Creates a new `Decoder` instance with default parameters.

Method Detail

### getDefaultParams

    public static Decoder.Params getDefaultParams()

### setEqualizer

    public void setEqualizer(Equalizer eq)

### decodeFrame

    public Obuffer decodeFrame(Header header,
                               Bitstream stream)
                        throws DecoderException

  Decodes one frame from an MPEG audio bitstream.

  Parameters:
    `header` - The header describing the frame to decode.
  Returns:
    A SampleBuffer containing the decoded samples.
  Throws:
    `DecoderException`

### setOutputBuffer

    public void setOutputBuffer(Obuffer out)

  Changes the output buffer. This will take effect the next time decodeFrame() is called.

### getOutputFrequency

    public int getOutputFrequency()

  Retrieves the sample frequency of the PCM samples output by this decoder. This typically corresponds to the sample rate encoded in the MPEG audio stream.

### getOutputChannels

    public int getOutputChannels()

  Retrieves the number of channels of PCM samples output by this decoder. This usually corresponds to the number of channels in the MPEG audio stream, although it may differ.

  Returns:
    The number of output channels in the decoded samples: 1 for mono, or 2 for stereo.

### getOutputBlockSize

    public int getOutputBlockSize()

  Retrieves the maximum number of samples that will be written to the output buffer when one frame is decoded. This can be used to help calculate the size of other buffers whose size is based upon the number of samples written to the output buffer. NB: this is an upper bound and fewer samples may actually be written, depending upon the sample rate and number of channels.

  Returns:
    The maximum number of samples that are written to the output buffer when decoding a single frame of MPEG audio.

### newDecoderException

    protected DecoderException newDecoderException(int errorcode)

### newDecoderException

    protected DecoderException newDecoderException(int errorcode,
                                                   java.lang.Throwable throwable)

### retrieveDecoder

    protected FrameDecoder retrieveDecoder(Header header,
                                           Bitstream stream,
                                           int layer)
                                    throws DecoderException

  Throws:
    `DecoderException`

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

JavaZOOM 1999-2005