Class SbDecoder

All Implemented Interfaces:
Codebook, Decoder

public class SbDecoder extends SbCodec implements Decoder
Sideband Speex Decoder
Version:
$Revision: 1.3 $
Author:
Jim Lawrence, helloNetwork.com, Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)
  • Field Details

    • lowdec

      protected Decoder lowdec
    • stereo

      protected Stereo stereo
    • enhanced

      protected boolean enhanced
    • innov2

      private float[] innov2
  • Constructor Details

    • SbDecoder

      public SbDecoder()
      Constructor
  • Method Details

    • wbinit

      public void wbinit()
      Wideband initialisation
      Overrides:
      wbinit in class SbCodec
    • uwbinit

      public void uwbinit()
      Ultra-wideband initialisation
      Overrides:
      uwbinit in class SbCodec
    • init

      public void init(int frameSize, int subframeSize, int lpcSize, int bufSize, float foldingGain)
      Initialisation
      Overrides:
      init in class SbCodec
      Parameters:
      frameSize -
      subframeSize -
      lpcSize -
      bufSize -
      foldingGain -
    • decode

      public int decode(Bits bits, float[] out) throws StreamCorruptedException
      Decode the given input bits.
      Specified by:
      decode in interface Decoder
      Parameters:
      bits - - Speex bits buffer.
      out - - the decoded mono audio frame.
      Returns:
      1 if a terminator was found, 0 if not.
      Throws:
      StreamCorruptedException - If there is an error detected in the data stream.
    • decodeLost

      public int decodeLost(float[] out, boolean dtx)
      Decode when packets are lost.
      Parameters:
      out - - the generated mono audio frame.
      dtx -
      Returns:
      0 if successful.
    • decodeStereo

      public void decodeStereo(float[] data, int frameSize)
      Decode the given bits to stereo.
      Specified by:
      decodeStereo in interface Decoder
      Parameters:
      data - - float array of size 2*frameSize, that contains the mono audio samples in the first half. When the function has completed, the array will contain the interlaced stereo audio samples.
      frameSize - - the size of a frame of mono audio samples.
    • setPerceptualEnhancement

      public void setPerceptualEnhancement(boolean enhanced)
      Enables or disables perceptual enhancement.
      Specified by:
      setPerceptualEnhancement in interface Decoder
      Parameters:
      enhanced -
    • getPerceptualEnhancement

      public boolean getPerceptualEnhancement()
      Returns whether perceptual enhancement is enabled or disabled.
      Specified by:
      getPerceptualEnhancement in interface Decoder
      Returns:
      whether perceptual enhancement is enabled or disabled.