Displaying 1 result from an estimated 1 matches for "getoutputlen".
2004 Aug 06
0
C++ wrapper for speex
...uf is float[] or short int[], buflen is multiple of frame size
// (there is a getFrameSize() method for both classes)
// Encode some audio
tgAudioEncoder enc(16000); // you could do 8000 instead
enc.enableVAD(1);
enc.encode(buf, buflen);
unsigned char *compressed = enc.getOutput();
int clen = enc.getOutputLen();
int speechDetected = enc.getSpeechDetected();
// Decode it
tgAudioDecoder dec(16000);
int decodedSamples = dec.decode(compressed, clen);
memcpy(buf, dec.getOutput(), decodedSamples * sizeof(short int));
Anyway, that's the basic idea. I don't think it could get much
easier. :) Now, t...