<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Jean-Marc Valin wrote:
<blockquote cite="mid:47ABD104.9010803@usherbrooke.ca" type="cite">
<pre wrap="">David Hogan wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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* ?
</pre>
</blockquote>
<pre wrap=""><!---->
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.
</pre>
</blockquote>
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.<br>
<br>
<a class="moz-txt-link-freetext" href="http://mlblog.osdir.com/audio.compression.speex.devel/2006-01/index.shtml">http://mlblog.osdir.com/audio.compression.speex.devel/2006-01/index.shtml</a><br>
<br>
Someone's even ported it to Java, it seems, here:<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.koders.com/java/fidAEF1846C82020C9EDC1E49EF2C3F2663BC99A242.aspx">http://www.koders.com/java/fidAEF1846C82020C9EDC1E49EF2C3F2663BC99A242.aspx</a><br>
<br>
-SteveK<br>
<br>
<br>
</body>
</html>