[vorbis] Realtime resampling/encoding with oggenc

vorbis vorbis at papaya.altamente.com
Tue May 15 08:51:04 PDT 2001



Theory looks sound.  I'll give it a shot.  Hehe, it never ceases to amaze
me all the uses for dd *G*.

Do one thing and do it well.

--james

On Tue, 15 May 2001, David Mitchell wrote:

> 
> > 
> > As for having to kill sox... I don't have much experience with sox, but
> > from what I can tell, there is no way to exit gracefully.  Man page, web
> > search, deja.com search yield nothing in the way of stoping sox
> > gracefully.  The best way to do it seems to be as stated.
> > 
> > --james
> 
> You could try putting dd in there to get the proper number of
> samples. some thing like:
> dd if=/dev/dsp bs=1024 count=1240312 | sox -etc -s - | oggenc
> 
> Fill in the proper options to sox and oggenc.  dd will output of
> STDOUT of you don't specify an output file. I'm guessing that "-s
> -" will tell sox to read from STDIN.
> 
> This will have dd read in about 2 hours worth of samples then
> exit. When it does, it will send an EOF to sox, which should make
> it close down, which will send an EOF to oggenc. I haven't tried
> this, but it should work.
> 
> -David Mitchell
> 
> > 
> > > On Tue, 15 May 2001, vorbis wrote:
> > >
> > > > Don't know if anybody is still missing the lame oggenc features for
> > > > resampling, lowpass/highpass filters etc, but I wrote a little script that
> > > > uses sox to do all the stuff I need to real-time encode oggenc from the
> > > > radio, or any input device.
> > > >
> > > > #!/bin/bash
> > > > DATE=`date '+%m-%d-%Y-(%H.%M)'`
> > > > DESTIN=/video/music/perftoday
> > > > export DATE=$DATE'-PerformanceToday.ogg'
> > > >
> > > > sox -V -r 44100 -c 2 -t ossdsp -w -s /dev/dsp -t wav - filter \
> > > > 0-16000 2>/dev/null | oggenc - -o $DESTIN/$DATE -b 128&
> > > > sleep 7200
> > > > kill -9 $!
> > > >
> > > > What you see here on the first two lines should be only one.  Note the
> > > > "\".
> > > >
> > > > As you can guess, I use this to record my favorite classical music program
> > > > on NPR.  Anyway, I hope this solves somebody's problem similar to mine.
> > > >
> > > Is it always healthy to lowpass a signal from the radio at 16KHz?  Is it
> > > the same for AM and FM?  I record most of my Ogg files from the radio
> > > (usually through an intermediate tapa cassete - how does this effect?).
> > > I usually encode without filtering.  I only once noticed that for a
> > > particular station which was recieved very weakly, there was a parasitic
> > > 18Khz noise.  Should I get into the habit of filtering?
> > >
> > > Unrelated question: the above script seems to kill the encoding as the
> > > normal means for ending a recording - is this a safe thing?  Does it only
> > > produce a little bad page/packet at the end that one can live with?
> > >
> > >
> > 
> > --- >8 ----
> > List archives:  http://www.xiph.org/archives/
> > Ogg project homepage: http://www.xiph.org/ogg/
> > To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
> > containing only the word 'unsubscribe' in the body.  No subject is needed.
> > Unsubscribe messages sent to the list will be ignored/filtered.
> 
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
> 

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list