[vorbis] developing with libvorbis

Greg Wooledge greg at wooledge.org
Wed Mar 26 17:59:19 PST 2003


Ed Sweetman (ed.sweetman at wmich.edu) wrote:

> except i get decodes that can go like this
> 
> 2304
> 4096
> 
> Now there is no easy way to handle something like that.  Suppose the 
> smallest data i can write to the soundcard is 2048bytes. Vorbis is 
> giving me stuff that's like 512, 1024  ...and sometimes 2304 and 4096. 

Wrap a buffer around the output.  Allocate, say, a 2048 byte buffer,
and keep a pointer to the "end" of it (wherever the next byte should
go).  With a bit of simple arithmetic every time you do a my_buf_write()
you can decide when to flush the buffer, and to copy data into it and
advance the pointer, etc.


-- 
Greg Wooledge                  |   "Truth belongs to everybody."
greg at wooledge.org              |    - The Red Hot Chili Peppers
http://wooledge.org/~greg/     |


-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis/attachments/20030326/9242ec71/part-0001.pgp


More information about the Vorbis mailing list