[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vorbis
Subject:    Re: [Vorbis] Write pure sine to *.ogg directly?
From:       Monty <xiphmont () localhost ! localdomain>
Date:       2006-02-20 19:49:09
Message-ID: 20060220194909.GC12987 () localhost ! localdomain
[Download RAW message or body]




On Mon, Feb 20, 2006 at 09:39:35AM -0500, Gan Uesli Starling wrote:
> I'd like some means of writing a pure sine wave straight
> to *.ogg just as I currently can to *.wav (using the Perl
> Audio::Wav module). 

Slightly more fundamnetally complex, but it wouldn't bee too hard if
you're not *too* picky about the *exact* frequency you want to output.

What will probably suck, though, is getting ahold of a perl binding
for libogg and enough of libvorbis to set a few packet fields.

> This would involve turning on and off a sine wave of N mS
> duration with silences between. And the leading edges of
> these sine-wave segments require a not-too-abrupt rise time
> to avoid what Morse folks call "key clicks" and, if I read
> correctly, cause "pre echos" in compressed audio. 

I'd expect you'd want to build the tone packets directly from the
spectral math you'd need for a given sine wave; preecho would be
vaguely irrelevant.

> Bearing in mind that I know nothing about audio codecs beyond
> being able to use Perl's Audio::Wav module, have I any hope of
> accomplishing such a task in Perl with output direct to *.ogg?
> Where would I start in such a case? 

Yes... but it depends on what perl bindings already exist.  Building
the vorbis packets in Perl wouldn't be too bad (I expect you only need
a couple 'canned' packets), but stitching them into the Ogg stream
would require a bit more code if Ogg code isn;t already available.

Monty
_______________________________________________
Vorbis mailing list
Vorbis@xiph.org
http://lists.xiph.org/mailman/listinfo/vorbis
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic