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

Steve Kann stevek at stevek.com
Fri Feb 8 05:30:22 PST 2008

Jean-Marc Valin wrote:
> David Hogan wrote:
>> Does anyone know a practical way to determine the number of 20ms speex
>> frames in a given speex packet without actually looping on speex_decode* ?
> There's no ready-made function for that. You'd have to write a function
> that inspects the bits, determines what mode is involved, and jump the
> right number of bits until a terminator is found or there's no more
> bytes. The narrowband decoder already does something similar when it
> encounters wideband data it doesn't want to decode.
We've written code to do just this, actually.  It's included in 
iaxclient and asterisk in the speex codec modules.  I've also written 
about it to this list (probably with code excerpts).  Google is your friend.


Someone's even ported it to Java, it seems, here:



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20080208/96296708/attachment.html

More information about the Speex-dev mailing list