The only annoyance is that you must send a flush in the end of every conversation. Let's say I speak: "Hello There!" and stop. You may hear Hello Ther unless I send a FLUSH packet.
Now can you please light my path here. I am totally lost.
I have:
7680 (PCM) / 2560 (Speex Frame) = 3 Coded Speex Frames
Each Coded Speex Frame is: 77
So I have 3 X 77 = 231 bytes of encoded Speex.
So far so good.
Now for the decoding part I have no clue what Speex Frame Size I use ???
So I tried the same 77:
With the following code:
CODE
decoder.processData(source, off, len);
for(int i=1;i<nSpeexFrames;i++) {
decoder.processData(false);
}
int x = decoder.getProcessedData(decoded, 0);
It works when I have 3 frames, but It does not work when I have 4 frames. It gives me this:
CODE
java.io.StreamCorruptedException: Invalid mode encountered: 12
at org.xiph.speex.NbDecoder.decode(Unknown Source)
at org.xiph.speex.SbDecoder.decode(Unknown Source)
at org.xiph.speex.SbDecoder.decode(Unknown Source)
at org.xiph.speex.SpeexDecoder.processData(Unknown Source)
at SpeexJMFDecoder.process(SpeexJMFDecoder.java:137)
I am actually close because I can hear my voice with the glitches. Please help me so I don't want to die on the beach !!!!