tgrand at canvaslink.com
Tue Jul 1 17:41:45 PDT 2003
Ok, I figured it out. :) This seems to work:
1) Call speex_bits_read_from() once, specifying the location in
memory of the compressed data, and the total length of that data.
2) Keep calling speex_decode() until speex_bits_remaining()
Then you don't have to keep track of the # of frames per packet,
or the size of each compressed frame. It's done magically by the
I now see that in section 4.5 of SpeexManual.pdf it touches on this
briefly, and mentions a terminator code. But, it's not quite clear
as to how this terminator code is used... especially since it refers
to figure 4 which doesn't seem to exist. (doc bug?)
Might I humbly recommend a section of documentation elaborating on
the use of the speex_bits*() calls ...
<p>Tom Grandgent (tgrand at canvaslink.com) wrote:
> I have a question about section 3.4 of the RTP payload draft:
> > Speex codecs  are able to detect the the bitrate from the
> > payload and are responsible for detecting the 20 msec boundaries
> > between each frame.
> This suggests that you can encode some frames with Speex, pass the
> compressed bits to the decoder, and you'll get the output - without
> having to do external bookkeeping for compressed frame size. (I'm
> thinking of VBR here where compressed frame size varies constantly.)
> If this is true, how does one go about leaving this responsibility to
> the codec? It seems like I have to pass the size of the compressed
> frame as the last parameter of speex_bits_read_from(), then call
> speex_decode() to decode one frame at a time. This is how the sample
> code in the manual works, and the reference manual doesn't shed any
> light on this.
> So basically, if I'm given an RTP packet with several back-to-back
> VBR-compressed Speex frames, how do I decode it?
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Speex-dev