[Vorbis] smallest page of encoded data

Adam Langley alangley at winscribe.com
Sun Mar 15 17:27:23 PDT 2009


Aha - this is a showstopper. I feared as much.
My end-goal is actually to do this with the SPEEX codec, but I'm using
Vorbis for now because I have previous experience with it. Am I going to
have the same problem with SPEEX?

Thanks

From: vorbis-bounces at xiph.org [mailto:vorbis-bounces at xiph.org] On Behalf
Of Carsten Haese
Sent: Monday, 16 March 2009 1:10 p.m.
To: vorbis at xiph.org
Subject: Re: [Vorbis] smallest page of encoded data

On Sun, Mar 15, 2009 at 7:37 PM, Adam Langley <alangley at winscribe.com>
wrote:
Hi,

I am implementing and audio recorder where I need to encode to vorbis
DURING recording.
I need to allow the user to cut and paste segments of encoded audio into
a new stream.
As such, I need to encode the audio in sub-second pages (the smallest
allowable amount for the wave format), so that cut/paste can be
implemented simply by re-arranging these encoded pages.

Somebody with more knowledge of Vorbis internals will probably correct
me if I'm wrong, but I don't think it's going to be that simple. Vorbis
uses an overlap transform in which the signal is shaped by a rising and
falling envelope prior to being encoded. To reconstruct the audio, you
need the falling slope of one block and the rising slope of the
following block, which are overlapped such that they can be added
together to yield the original waveform. This makes it fundamentally
difficult to perform cut and paste by "simply" rearranging blocks.
(Unless you're okay with the "cross-fade" artifacts that you'll most
likely get by allowing a block to be followed by a block with which it's
not intended to fit together.)

-Carsten


More information about the Vorbis mailing list