[Vorbis] Re: Write pure sine to *.ogg directly?

Ralph Giles giles at xiph.org
Mon Feb 20 12:42:35 PST 2006


On Mon, Feb 20, 2006 at 03:32:10PM -0500, Gan Uesli Starling wrote:

> What docs ought I read first? And where might I find them? 

I'd start with Ogg. Documented here:

 http://xiph.org/ogg/doc/oggstream.html
 http://xiph.org/ogg/doc/framing.html

or equivalently:

 http://xiph.org/ogg/doc/rfc3533.txt

if more formal language is your thing.

It should be quite easy to implement an ogg writer in perl; calculating 
the CRC is the only tricky part; the rest is just filling in some byte 
fields, especially if you take the lazy route and only write one Ogg 
page per vorbis packet.

After that, you'll have to look at the vorbis spec for how to construct 
a the vorbis packets.

 http://xiph.org/vorbis/doc/Vorbis_I_spec.html

That's a lot more reading. I guess you'd want a floor with a single peak 
and no residual?

You might also be able to cheat by running a signal that starts and 
stops at fixed points relative to the block sizes through oggenc, and
then cut and pasting packets from that into your perl code. Whether 
that's easier than generating packets from scratch probably depends on
how you think. :)

HTH, and cool project,
 -r


More information about the Vorbis mailing list