[Vorbis-dev] Controlling the vorbis encoder precisely

Robin Siegemund r.siegemund at digitalpublishing.de
Fri Nov 23 02:23:46 PST 2007


Hello,

currently I'm working on a vorbis based encoder that adds multiple single wave sounds into one vorbis stream (and put every sound in one or more ogg pages). During the process an index is written in an extra file so later you can locate a sound's position easily by a file position and length value.

The problem is the sample-exact separation between those encoded wave sounds: If I add the audio data from a new wave sound to the encoding process the resulting vorbis packets also include some samples from the previous encoded wave file at the beginning.
This seems to be caused by the vorbis encoder using a "delay window" (or something like that) during the process so there's always some data left in the current encoding state.

So how can I flush those cached samples before every new audio data I'm going to add to the encoding process?
Unfortunately there's still no documentation of libvorbis available even the original source code has no comments at all. And those encoder examples don't use all of the provided functionality.
I tried the function vorbis_synthesis_restart() because it's named like the thing I've looking for but it doesn't work as expected.

Currently I only use a hack which produces good but not perfect results: Before I add data from a new wave sound to the encoding process I set the pcm_current variable in the vorbis dsp state to 0 (it's typical size is about 3500). But there should be a more appropriate solution, isn't it?

I'm looking forward to get some hints on this.

Thx,
Robin Siegemund, 
dp

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20071123/63db2a46/attachment.html


More information about the Vorbis-dev mailing list