[Vorbis-dev] Controlling the vorbis encoder precisely

Erik de Castro Lopo mle+la at mega-nerd.com
Fri Nov 23 20:02:54 PST 2007


Robin Siegemund wrote:

> currently I'm working on a vorbis based encoder that adds multiple
> single wave sounds into one vorbis stream

Why haven't you put them ins spearate streams?

> 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.

What you are basically doing is concatenating all the wave sounds than
then running that concatenated signal through the encoder.

Lossy encoders (like Vorbis and MP3) perform analysis on (possibly
overlapping) chunks of audio and then looking for a way to encode
that chunk at the require bit rate.

If you butt to wave sounds up against one another then you will get bleed
from one to the other across the boundary.

There are two ways of avoiding this:

  - Use lossless encoding like FLAC.
  - Insert large chunks of silence between the wave sounds.

> So how can I flush those cached samples before every new audio data
> I'm going to add to the encoding process?

You can have this if you start a new stream for each separate wave.

HTH,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Microsoft's biggest weakness is that they still don't realize how
much they suck." -- Paul Graham


More information about the Vorbis-dev mailing list