[Speex-dev] Speex granulepos definition

Jean-Marc Valin Jean-Marc.Valin at USherbrooke.ca
Mon Jun 20 17:31:02 PDT 2005

> so is the following correct, for the example you gave (narrowband):
> 1) decoding the first packet produces 80 samples, and it has a granulepos
> of 80.
> 2) decoding any subsequent packet produces 160 samples, and has a
> granuelpos "N*160 - 80"

That's right, or at least how it should be now. Older versions of the encoder
(1.1.5 and older, 1.0.3 and older) used to just use 160*N (in narrowband), so
there was 80 samples of silence. One other thing is that the 80 for narrowband
isn't hardcoded and should be obtained from SPEEX_GET_LOOKAHEAD. I've also been
thinking of just inserting zeros (frame size - lookahead) when encoding the
first frame, so it can simply be discarded.


More information about the Speex-dev mailing list