I promised this a while back and got sidetracked by RL. ;)  So here it
is. 

This is what it takes to record broadcasts off the net in ogg format. 
Using Sox (which is the best sound util ever made) you can also record
just about anything that your soundcard puts out; VERBATIM. 

Sox is a deceptively innocuous utility that endows the user with a huge
amount of power and flexibility with sound streams that are routed thru
the soundcard.  By trade and public presentation, Sox was originally
touted as a file format conversion utility.  However Sox's real power 
comes in it's ability to snatch an audio stream from /dev/dsp and
convert it into the file format of your choice.  In this case, our
choice will be Ogg Vorbis. 

There are fully 24 file formats listed in the Sox man page. You can
encode to or convert between all of them. Oddly enough, Ogg Vorbis is
not amongst them; at least in the LM82 version of the Sox man pages. 

The first wrinkle that we encounter is the fact that Sox as installed
from the Mandrake LM81/82 CD's does NOT encode Ogg capability.  Ogg
Vorbis encoding/conversion is indeed supported under Sox, however you
need to read the source documentation to catch this clue.  To his
credit, the current maintainer of Sox Chris Bagwell does give Ogg an
honorable mention on his website.  Which is: 

http://home.sprynet.com/~cbagwell/sox.html

In order to get Ogg capability we must compile it in.  Unfortunately,
running rpm --rebuild on  sox-12.17.1-3mdk.src.rpm will not do this; it
will not detect installed oggvorbis libraries, and you will be forced to
do two things.  One is to recompile the source code.  The other is that
you must have the ogg vorbis libraries installed. The next time somebody
redoes the sox source rpm it would be nice if their configure routine
checks for Ogg Vorbis libs.(HINT HINT nudge nudge)

The devels may not be needed, I haven't checked. But this is what I have
installed according to Rpmdrake: 

libogg0 
libogg0-devel 
libvorbis0 
libvorbis0-devel 

If you don't have those, do a search for them using rpmdrake and get
them installed off of your installation cd's.  Next, make sure that you
have the rpm version of Sox installed.  Yes I know I just said that the
rpm binary version of Sox does not support Ogg; however we need to
maintain some semblance of order with regard to the RPM database and in
order to do that we are going to cheat a little, since we must deal with
a direct source to binary install. 

Make sure you have the Sox rpm installed.  Now we go to CVS and download
the latest Sox code.  That's right, if we've got to go pure source we
might as well go to the....well, the source.  Hehe.  Go to your home or
main /tmp directory and enter the following as a non-root user in a
terminal command line: 

cvs -d :pserver:[EMAIL PROTECTED]:/cvsroot/sox login 

(when prompted for a password here hit enter) 


cvs -z3 -d :pserver:[EMAIL PROTECTED]:/cvsroot/sox co
sox 


And after the last line you should see a "sox" directory created and the
CVS download will commence. 

After you have the entire CVS tree, su to root.  Make sure you su to
root.  Descend into the "sox" directory and enter the following two
commands: 

./configure 
make 

After that we need to edit the Makefile that we just made. Do 

vi Makefile 

If you are not a member of the one true vi faith, you may be able to
scrape by with another of the lesser heretic faiths.  I personally don't
recommend it, however. 

In any case, at the beginning of the Makefile you will see the
following: 


______________________________________________________________ 

# Makefile.in 
# 
# Processed by configure into a Makefile.  We assume the environment in 
# which we are running is a POSIX'y environment.  Thus, all of the
standard 
# POSIX tools are available. 
# 

# Paths 


srcdir = . 
prefix = /usr/local 
exec_prefix = ${prefix} 
bindir = ${exec_prefix}/bin 
libdir = ${exec_prefix}/lib 
mandir = ${prefix}/man 
includedir = ${prefix}/include 

*****snip****** 

Change "prefix = /usr/local" to "prefix = /usr".  That's all.  Save and
exit. 

Now from the "sox" CVS dir do 

make install 

And you will see stuff happen. You should be root as you do "make
install". 

Now do "sox -h" and you should see the following: 
_____________________________________________________________ 

[elx@tamriel elx]$ sox -h 
sox: Version 12.17.3 

Usage: [ gopts ] [ fopts ] ifile [ fopts ] ofile [ effect [ effopts ] ] 

gopts: -e -h -p -v volume -V 

fopts: -r rate -c channels -s/-u/-U/-A/-a/-i/-g/-f -b/-w/-l/-d -x 

effect: avg band bandpass bandreject chorus compand copy dcshift deemph
earwax echo echos fade filter flanger highp highpass lowp lowpass map
mask pan phaser pitch polyphase rate resample reverb reverse silence
speed stat stretch swap synth trim vibro vol 

effopts: depends on effect 

Supported file formats: aiff al alsa au auto avr cdr cvs dat vms gsm
hcom la lu maud nul ossdsp prc raw sb sf sl smp sndt sph 8svx sw txw ub
ul uw voc vorbis wav wve 

______________________________________________________________ 

The word "vorbis" above means that we were successful, and we can now
encode in that file format gift from the gods, Ogg Vorbis.  The reason
that we changed the Makefile was because this puts the binaries right
over where the rpm places them.  Now the rpm database identifies your
compiled source binaries as having been installed by rpm.  Which they
were not...but you can still remove everything using rpmdrake.  It also
precludes the possibility that you might ever have two copies of all the
sox binaries on your system; one in /usr/bin and the other in
/usr/local/bin. 



This email is big, so I'll break this up into several installments. 
Next email I'll describe the command line options for grabbing audio
with Sox and also some aspects of Realplayer. 

Best Regards, 

LX 

-- 
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
Kernel  2.4.18-6mdk     Mandrake Linux  8.2
Enlightenment 0.16.5-11mdk    Evolution  1.0.2-5mdk
Registered Linux User #268899 http://counter.li.org/
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to