[Speex-dev] Size in samples of a Speex packet

Steve Kann stevek at stevek.com
Sun Jul 8 12:14:43 PDT 2007


Chris Flerackers wrote:
> Hi Steve,
>
> Steve Kann wrote:
>> Chris Flerackers wrote:
>>> Hi,
>>>
>>> Is there an easy way to get the size in samples of a Speex packet, 
>>> without decoding the packet?
>>>
>>> If I receive a "narrowband packet" with
>>> - Zero or more wideband frames (must be skipped apparently)
>>> - Zero or more Speex inband requests
>>> - Zero or more user inband requests
>>> - One or more narrowband frames
>>> I need to know how much samples the packet contains to calculate 
>>> jitter buffer values (e.g. how much samples are available in the 
>>> jitter buffer).
>>>
>>> I cannot decode the packet prematurely, because packets may need to 
>>> be reordered first.
>>>
>>> How is this (multiple frames in one packet) handled by the Speex 
>>> jitter buffer?
>>>
>> See http://lists.xiph.org/pipermail/speex-dev/2007-March/005428.html
>
>
> Thanks for the reference. This is actually what I did for the moment.
>
> But I was wondering if such a function shouldn't be part of the 
> official Speex implementation?

That's up to Jean-Marc, I suppose.  I'm happy to assign copyright on it, 
if he thinks it's appropriate for the distribution.  I think I proposed 
this at some point, but I may be misremembering.  It seems that this is 
the second time in a few months that someone asked for something like this.

It's actually somewhat useful outside the distribution, though, because 
it works even in cases where for whatever reason, you want to be able to 
parse the packets when you don't have the actual library available.

-SteveK




More information about the Speex-dev mailing list