org.xiph.speex

Interface Encoder

Known Implementing Classes:
NbEncoder, SbEncoder

public interface Encoder

Speex Encoder interface, used as a base for the Narrowband and sideband encoders.
Version:
$Revision: 1.2 $
Author:
Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)

Method Summary

int
encode(Bits bits, float[] in)
Encode the given input signal.
int
getAbr()
Returns the Average Bit Rate used (0 if ABR is not turned on).
int
getBitRate()
Get the current Bit Rate.
int
getComplexity()
Returns the algorthmic complexity.
boolean
getDtx()
Returns whether or not we are using Discontinuous Transmission encoding.
int
getEncodedFrameSize()
Returns the size in bits of an audio frame encoded with the current mode.
float[]
getExc()
Returns the excitation array.
int
getFrameSize()
Returns the size of a frame.
float[]
getInnov()
Returns the innovation array.
int
getLookAhead()
Return LookAhead.
int
getMode()
Returns the encoding submode currently in use.
float[]
getPiGain()
Returns the Pitch Gain array.
float
getRelativeQuality()
Returns the relative quality.
int
getSamplingRate()
Returns the sampling rate.
boolean
getVad()
Returns whether or not we are using Voice Activity Detection encoding.
boolean
getVbr()
Returns whether or not we are using Variable Bit Rate encoding.
float
getVbrQuality()
Returns the Varible Bit Rate Quality.
void
setAbr(int abr)
Sets the Average Bit Rate.
void
setBitRate(int bitrate)
Sets the bitrate.
void
setComplexity(int complexity)
Sets the algorithmic complexity.
void
setDtx(boolean dtx)
Sets whether or not to use Discontinuous Transmission encoding.
void
setMode(int mode)
Sets the encoding submode.
void
setQuality(int quality)
Sets the Quality (between 0 and 10).
void
setSamplingRate(int rate)
Sets the sampling rate.
void
setVad(boolean vad)
Sets whether or not to use Voice Activity Detection encoding.
void
setVbr(boolean vbr)
Sets whether or not to use Variable Bit Rate encoding.
void
setVbrQuality(float quality)
Sets the Varible Bit Rate Quality.

Method Details

encode

public int encode(Bits bits,
                  float[] in)
Encode the given input signal.
Parameters:
bits - - Speex bits buffer.
in - - the raw mono audio frame to encode.
Returns:
1 if successful.

getAbr

public int getAbr()
Returns the Average Bit Rate used (0 if ABR is not turned on).
Returns:
the Average Bit Rate used (0 if ABR is not turned on).

getBitRate

public int getBitRate()
Get the current Bit Rate.
Returns:
the current Bit Rate.

getComplexity

public int getComplexity()
Returns the algorthmic complexity.
Returns:
the algorthmic complexity.

getDtx

public boolean getDtx()
Returns whether or not we are using Discontinuous Transmission encoding.
Returns:
whether or not we are using Discontinuous Transmission encoding.

getEncodedFrameSize

public int getEncodedFrameSize()
Returns the size in bits of an audio frame encoded with the current mode.
Returns:
the size in bits of an audio frame encoded with the current mode.

getExc

public float[] getExc()
Returns the excitation array.
Returns:
the excitation array.

getFrameSize

public int getFrameSize()
Returns the size of a frame.
Returns:
the size of a frame.

getInnov

public float[] getInnov()
Returns the innovation array.
Returns:
the innovation array.

getLookAhead

public int getLookAhead()
Return LookAhead.
Returns:
LookAhead.

getMode

public int getMode()
Returns the encoding submode currently in use.
Returns:
the encoding submode currently in use.

getPiGain

public float[] getPiGain()
Returns the Pitch Gain array.
Returns:
the Pitch Gain array.

getRelativeQuality

public float getRelativeQuality()
Returns the relative quality.
Returns:
the relative quality.

getSamplingRate

public int getSamplingRate()
Returns the sampling rate.
Returns:
the sampling rate.

getVad

public boolean getVad()
Returns whether or not we are using Voice Activity Detection encoding.
Returns:
whether or not we are using Voice Activity Detection encoding.

getVbr

public boolean getVbr()
Returns whether or not we are using Variable Bit Rate encoding.
Returns:
whether or not we are using Variable Bit Rate encoding.

getVbrQuality

public float getVbrQuality()
Returns the Varible Bit Rate Quality.
Returns:
the Varible Bit Rate Quality.

setAbr

public void setAbr(int abr)
Sets the Average Bit Rate.
Parameters:
abr - - the desired Average Bit Rate.

setBitRate

public void setBitRate(int bitrate)
Sets the bitrate.
Parameters:
bitrate -

setComplexity

public void setComplexity(int complexity)
Sets the algorithmic complexity.
Parameters:
complexity - - the desired algorithmic complexity (between 1 and 10 - default is 3).

setDtx

public void setDtx(boolean dtx)
Sets whether or not to use Discontinuous Transmission encoding.
Parameters:
dtx -

setMode

public void setMode(int mode)
Sets the encoding submode.
Parameters:
mode -

setQuality

public void setQuality(int quality)
Sets the Quality (between 0 and 10).
Parameters:
quality - - the desired Quality (between 0 and 10).

setSamplingRate

public void setSamplingRate(int rate)
Sets the sampling rate.
Parameters:
rate - - the sampling rate.

setVad

public void setVad(boolean vad)
Sets whether or not to use Voice Activity Detection encoding.
Parameters:
vad -

setVbr

public void setVbr(boolean vbr)
Sets whether or not to use Variable Bit Rate encoding.
Parameters:
vbr -

setVbrQuality

public void setVbrQuality(float quality)
Sets the Varible Bit Rate Quality.
Parameters:
quality - - the desired Varible Bit Rate Quality.

Copyright © 1999-2004 Wimba S.A. All Rights Reserved.