Jump to content

How to capture realaudio to mp3


Guest anon
 Share

Recommended Posts

Originally posted by Scrat ( old board )

 

Hey! Finally I have found the way out! How To Record Streaming Audio... I remember posting here on this stuff some months ago. There was a problem with vsound, I was unable to pipe its stdout into lame (or into anything for that matter). Finally today I have found a clue on a mailing list archive! There is a bug in vsound: it's a script, /usr/bin/vsound, you can edit it with emacs or whatever (as root). There is a line like:

 

if [ "$verbose" ] && [ "$VSOUND_STDOUT" ]; then

 

change it to

 

if [ "$verbose" = 1 ] && [ "$VSOUND_STDOUT" ]; then

 

(Ugly-Details-Feel-Free-To-Skip: the other way, since $verbose is always set, whenever $vsound_stdout is set, the "if" is fulfilled and it exits with an error that both verbose and -s cannot be passed together; $vsound_stdout is set if you pass the option -s to the command line, which in turn means "use stdout". So passing -s would always fail. After the modification above, it fails only if you pass both -s and --verbose).

 

After the bugfix, a simple commandline like

 

vsound -t -s -d realplay | lame -h - myfilel.mp3

 

will launch realplay under vsound, and record/encode on the fly whatever is played by realplay to myfile.mp3 ! (hit CTRL+C when you are done).Without intermediate huge wav files.

Great ain't it ?

 

(Notice that this is better tha using sox to read from dsp, because there is not a double DA/AD conversion)

 

Hope you'll like it too... Scrat

Well good people, another hint if you like to record real streaming audio to mp3. If you do what I suggest in last post, you'll end up with a long .mp3 containing songs, dj voices, silence, all interspersed. You'd like to cut the songs and store them as individual mp3's with their title as filename and without voices etc, wouldn't you ? You could use audacity to do that, but this would NOT be a great idea: because audacity first decompresses the mp3, then it lets you edit it, then it compresses it again := quality loss each time you save. But there is a nifty program that cuts mp3 into pieces WITHOUT decompression/re-compression ! Of course that's all it can do, you can't aplly filters and other advanced stuff you can do with audacity. But if you only need to cut the mp3 into pieces, it's EXACTLY what you need. It's called mpcut, you can get it here:

 

http://minnie.tuhs.org/Programs/Mpcut/

 

Get the tarball, untar it , enter the mpcut-whatever directory, type

 

./autogen.sh

 

wait till'it ends, then type

 

make

 

when it's done enter the src directory, you'll find there the executable, it's called mpcut. You can run it from there, typing

 

./mpcut

 

or you can copy (become root first) it in a directory wich is in your PATH, like /usr/local/bin , so you'll have only to type mpcut to launch it.

Enjoy, and good ripping ! Scrat

 

PS Another little tip, more like an errata; I wrote "hit CTRL+C when you're done"; well, actually it is better to exit the client application, that is, realplay in the example commandline (but it could be xmms or another app, provided it uses oss-like /dev/dsp because that's what vsound intercepts). So if you click Exit on realplay, vsound will exit itself after finishing to write it's output; lame in turn will see the end of the pipe as the end of a regular file, and finish gracefully it's job before exiting. Instead CTRL+C will make lame to exit of a sudden, which sometimes produces (well, that's what happens to me) broken mp3's. Broken means I can play them all the same and they sound good, but mpg123 may complain that it can't rewind the stream (wish I knew what that means me too), and mpcut may crash while attempting to open the file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...