|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xiph.speex.SpeexEncoder
Main Speex Encoder class. This class encodes the given PCM 16bit samples into Speex packets.
Field Summary | |
private Bits |
bits
|
private int |
channels
|
private Encoder |
encoder
|
private int |
frameSize
|
private float[] |
rawData
|
private int |
sampleRate
|
static java.lang.String |
VERSION
Version of the Speex Encoder |
Constructor Summary | |
SpeexEncoder()
Constructor |
Method Summary | |
int |
getChannels()
Returns the number of channels. |
Encoder |
getEncoder()
Returns the Encoder being used (Narrowband, Wideband or Ultrawideband). |
int |
getFrameSize()
Returns the size of a frame. |
int |
getProcessedData(byte[] data,
int offset)
Pull the decoded data out into a byte array at the given offset and returns the number of bytes of encoded data just read. |
int |
getProcessedDataByteSize()
Returns the number of bytes of encoded data ready to be read. |
int |
getSampleRate()
Returns the sample rate. |
boolean |
init(int mode,
int quality,
int sampleRate,
int channels)
Initialisation |
static void |
mapPcm16bitLittleEndian2Float(byte[] pcm16bitBytes,
int offsetInput,
float[] samples,
int offsetOutput,
int length)
Converts a 16 bit linear PCM stream (in the form of a byte array) into a floating point PCM stream (in the form of an float array). |
boolean |
processData(byte[] data,
int offset,
int len)
This is where the actual encoding takes place |
boolean |
processData(float[] data,
int numSamples)
Encode an array of floats. |
boolean |
processData(short[] data,
int offset,
int numShorts)
Encode an array of shorts. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String VERSION
private Encoder encoder
private Bits bits
private float[] rawData
private int sampleRate
private int channels
private int frameSize
Constructor Detail |
public SpeexEncoder()
Method Detail |
public boolean init(int mode, int quality, int sampleRate, int channels)
mode
- quality
- sampleRate
- channels
-
public Encoder getEncoder()
public int getSampleRate()
public int getChannels()
public int getFrameSize()
public int getProcessedData(byte[] data, int offset)
data
- offset
-
public int getProcessedDataByteSize()
public boolean processData(byte[] data, int offset, int len)
data
- offset
- len
-
public boolean processData(short[] data, int offset, int numShorts)
data
- offset
- numShorts
-
public boolean processData(float[] data, int numSamples)
data
- numSamples
-
public static void mapPcm16bitLittleEndian2Float(byte[] pcm16bitBytes, int offsetInput, float[] samples, int offsetOutput, int length)
pcm16bitBytes
- - byte array of linear 16-bit PCM formated audio.offsetInput
- samples
- - float array to receive the 16-bit linear audio samples.offsetOutput
- length
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |