[Speex-dev] Determine number of 20ms frames in packet - without decoding

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Tue Feb 12 13:32:17 PST 2008

Hi Alexander,

> Here is first attempt. I'm sending it here for review - am I understand
> you correctly? If general approach is correct, I'll change code to use
> modes from modes.c.

I haven't tested, but it looks sane. Just a few comments:

- printf("\tERROR not enough bits left after wb\n"); this is actually
now an error. It just means you got to the end of the frame

- I suggest speex_get_num_frames() instead. That works for both
narrowband and wideband. Number of samples could be misleading because
of nb vs wb frame size.

- You can change it to use the nb mode info in modes.c, but leave the
wideband like it is now. Otherwise, it would cause the wideband stuff to
be linked in all the time.

> One question - as far as I understand, to get number of samples
> we should not parse WB frames even in (U)WB mode, becuase
> in WB mode "meta"-frame consist of NB frame, and WB frame.
> Is it correct?

I don't understand your question.


More information about the Speex-dev mailing list