[vorbis-dev] Flushing audio

Michael Smith msmith at xiph.org
Thu Sep 11 23:07:26 PDT 2003



On Friday 12 September 2003 15:52, Eric Ross wrote:
> My problem is that in some cases, i capture some data from the sound card
> and i feed it to this function, but vorbis_analysus_blockout doesnt output
> any block.
>
> When i encode all the data i capture from the sound card (continuos
> audio), it works fine. But if i start detecting levels, and sending to the
> encoder only the audio louder that some level, in some cases
> vorbis_analysis_blockout returns 0.  I guess it's because it doesnt have
> enought data to output a regular block.
>
> Any idea how can i make it work ? Or maybe using vorbis to try to transmit
> realtime audio is not a good idea ?

Though vorbis would generally be ok for realtime use, the libvorbis vorbis 
encoder is definately not designed for realtime. 

Using full VBR (i.e. non-managed modes) will drastically reduce the latency, 
but it'll still be high. If you need to do this, you may have to write your 
own vorbis encoder (but it depends on just what latency you can tolerate - 10 
ms? 50 ms? 100 ms? 500 ms? Vorbis won't do 10 ms, 50 ms would be very 
marginal and probably not possible, 100 ms or more should be fine if you take 
appropriate care.)

You'd also find that the ogg layer has a lot of overhead if you do it like 
this (one packet per page), so you'd want to do it differently anyway (see, 
for example, the vorbis-over-RTP drafts).

You might also be able to get away with it (again, this depends: you haven't 
given much detail, so I can't say for sure) by just ensuring you always write 
blocks of audio of some minimum size (for VBR modes, this size needn't be all 
that large. It depends on sampling rate, so give more details if you want 
recommendations on this), and using a low-latency encapsulation layer (i.e. 
probably not ogg).

Mike

--- >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 'vorbis-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 Vorbis-dev mailing list