Package javaforce.codec.speex
Interface Encoder
public interface Encoder
Speex Encoder interface, used as a base for the Narrowband and sideband
encoders.
- Version:
- $Revision$
- Author:
- Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)
-
Method Summary
Modifier and TypeMethodDescriptionintEncode the given input signal.intgetAbr()Returns the Average Bit Rate used (0 if ABR is not turned on).intGet the current Bit Rate.intReturns the algorthmic complexity.booleangetDtx()Returns whether or not we are using Discontinuous Transmission encoding.intReturns the size in bits of an audio frame encoded with the current mode.float[]getExc()Returns the excitation array.intReturns the size of a frame.float[]getInnov()Returns the innovation array.intReturn LookAhead.intgetMode()Returns the encoding submode currently in use.float[]Returns the Pitch Gain array.floatReturns the relative quality.intReturns the sampling rate.booleangetVad()Returns whether or not we are using Voice Activity Detection encoding.booleangetVbr()Returns whether or not we are using Variable Bit Rate encoding.floatReturns the Varible Bit Rate Quality.voidsetAbr(int abr) Sets the Average Bit Rate.voidsetBitRate(int bitrate) Sets the bitrate.voidsetComplexity(int complexity) Sets the algorithmic complexity.voidsetDtx(boolean dtx) Sets whether or not to use Discontinuous Transmission encoding.voidsetMode(int mode) Sets the encoding submode.voidsetQuality(int quality) Sets the Quality (between 0 and 10).voidsetSamplingRate(int rate) Sets the sampling rate.voidsetVad(boolean vad) Sets whether or not to use Voice Activity Detection encoding.voidsetVbr(boolean vbr) Sets whether or not to use Variable Bit Rate encoding.voidsetVbrQuality(float quality) Sets the Varible Bit Rate Quality.
-
Method Details
-
encode
Encode the given input signal.- Parameters:
bits- - Speex bits buffer.in- - the raw mono audio frame to encode.- Returns:
- 1 if successful.
-
getEncodedFrameSize
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.
-
getFrameSize
int getFrameSize()Returns the size of a frame.- Returns:
- the size of a frame.
-
setQuality
void setQuality(int quality) Sets the Quality (between 0 and 10).- Parameters:
quality- - the desired Quality (between 0 and 10).
-
getBitRate
int getBitRate()Get the current Bit Rate.- Returns:
- the current Bit Rate.
-
getPiGain
float[] getPiGain()Returns the Pitch Gain array.- Returns:
- the Pitch Gain array.
-
getExc
float[] getExc()Returns the excitation array.- Returns:
- the excitation array.
-
getInnov
float[] getInnov()Returns the innovation array.- Returns:
- the innovation array.
-
setMode
void setMode(int mode) Sets the encoding submode.- Parameters:
mode-
-
getMode
int getMode()Returns the encoding submode currently in use.- Returns:
- the encoding submode currently in use.
-
setBitRate
void setBitRate(int bitrate) Sets the bitrate.- Parameters:
bitrate-
-
setVbr
void setVbr(boolean vbr) Sets whether or not to use Variable Bit Rate encoding.- Parameters:
vbr-
-
getVbr
boolean getVbr()Returns whether or not we are using Variable Bit Rate encoding.- Returns:
- whether or not we are using Variable Bit Rate encoding.
-
setVad
void setVad(boolean vad) Sets whether or not to use Voice Activity Detection encoding.- Parameters:
vad-
-
getVad
boolean getVad()Returns whether or not we are using Voice Activity Detection encoding.- Returns:
- whether or not we are using Voice Activity Detection encoding.
-
setDtx
void setDtx(boolean dtx) Sets whether or not to use Discontinuous Transmission encoding.- Parameters:
dtx-
-
getDtx
boolean getDtx()Returns whether or not we are using Discontinuous Transmission encoding.- Returns:
- whether or not we are using Discontinuous Transmission encoding.
-
getAbr
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).
-
setAbr
void setAbr(int abr) Sets the Average Bit Rate.- Parameters:
abr- - the desired Average Bit Rate.
-
setVbrQuality
void setVbrQuality(float quality) Sets the Varible Bit Rate Quality.- Parameters:
quality- - the desired Varible Bit Rate Quality.
-
getVbrQuality
float getVbrQuality()Returns the Varible Bit Rate Quality.- Returns:
- the Varible Bit Rate Quality.
-
setComplexity
void setComplexity(int complexity) Sets the algorithmic complexity.- Parameters:
complexity- - the desired algorithmic complexity (between 1 and 10 - default is 3).
-
getComplexity
int getComplexity()Returns the algorthmic complexity.- Returns:
- the algorthmic complexity.
-
setSamplingRate
void setSamplingRate(int rate) Sets the sampling rate.- Parameters:
rate- - the sampling rate.
-
getSamplingRate
int getSamplingRate()Returns the sampling rate.- Returns:
- the sampling rate.
-
getLookAhead
int getLookAhead()Return LookAhead.- Returns:
- LookAhead.
-
getRelativeQuality
float getRelativeQuality()Returns the relative quality.- Returns:
- the relative quality.
-