Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A Going Away Present - Real Audio Ripping with Esound.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Thu Mar 20, 2003 1:22 pm    Post subject: A Going Away Present - Real Audio Ripping with Esound. Reply with quote

I haven't been very active around here lately, and soon, I may find myself without access to a linux desktop for quite some time. A friend recently asked me if Linux had anything like the windows program "Total Recorder", to allow him to listen to Real Audio streams while he was offline, and I drafted this script in response. I thought someone here might be able to use it.

$HOME/bin/realplay:
Code:
#!/bin/sh
filename=/tmp/esddata.stream.$$.raw
esdmon $filename &
/opt/RealPlayer8/realplay $1
killall esdmon
oggenc -r $filename -o ~/realgrab-`date +%s`.ogg
rm $filename


No guarantees, as usual, but it seems to work alright for me, and esdmon seems to intelligently omit silent areas at the beginning of the recording. To set it up, you'll need to tell RealPlayer to use Esd for its output, and try to get your other esound applications to shut up ( I don't usually use esd, so this is easy for me ). Of course, you'll also need oggenc, but you could substitute lame or bladeenc with command line switches as appropriate. :-)

Goodbye, Gentoo, and beloved Gentoo Community. I won't forget the good times we had together.

-- Curious
_________________
Are you down with the Hawk?
Back to top
View user's profile Send private message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Thu Mar 20, 2003 1:28 pm    Post subject: Reply with quote

For anyone wondering, I think the best reason to have RealPlayer installed is for the Seeing Ear Theater at Scifi.com :-)

http://www.scifi.com/set/

Both the City of Dreams material by JMS ( Bab5 JMS, Yes ) and the Tales from the Crypt stuff are fantastic. The rest of it is great as well.

-- Curious
_________________
Are you down with the Hawk?


Last edited by Curious on Fri Mar 21, 2003 1:41 am; edited 1 time in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Mar 20, 2003 5:36 pm    Post subject: Reply with quote

Come back when you can, and thanks for contributing.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Runny
n00b
n00b


Joined: 11 Mar 2003
Posts: 19
Location: Fairfield, NJ

PostPosted: Mon Mar 24, 2003 8:07 pm    Post subject: Reply with quote

vsound also works quite well. Remember that for Internet streams you need the -t option.
Back to top
View user's profile Send private message
puggy
Bodhisattva
Bodhisattva


Joined: 28 Feb 2003
Posts: 1992
Location: Oxford, UK

PostPosted: Sun Mar 30, 2003 4:52 pm    Post subject: Reply with quote

ok. I made the script, but using lame instead of oggenc and the script is as follows...

Code:

#!/bin/sh
filename=/tmp/esddata.stream.$$.raw
esdmon $filename &
/opt/RealPlayer8/realplay $1
killall esdmon
lame -r $filename -o ~/realgrab-`date +%s`.mp3
rm $filename


I ran the script with the direct link to the real-audio stream I wanted to record...
Code:
puggy@aragorn puggy $ sh realrip.sh http://www.ninjatune.net/solidsteel/getreal.php?file=solidsteel/mar03/03.03.17_1.rm

the real audio stream plays and I can hear it perfectly. I then shut realplayer after 60 seconds or so...
lame then encodes the output, but when I play the output mp3 file (which is the correct length) its just noise. Am I being stupid here?
The output is...
Code:
puggy@aragorn puggy $ sh realrip.sh http://www.ninjatune.net/solidsteel/getreal.php?file=solidsteel/mar03/03.03.17_1.rm
opening socket, format = 0x00001021 at 44100 Hz
realrip.sh: line 5:  8224 Terminated              esdmon $filename
Assuming raw pcm input file
LAME version 3.93 MMX  (http://www.mp3dev.org/)
CPU features: i387, MMX (ASM used), 3DNow! (ASM used), SIMD
Using polyphase lowpass  filter, transition band: 15115 Hz - 15648 Hz
Encoding /tmp/esddata.stream.8223.raw to /home/puggy/realgrab-1049046316.mp3
Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=2
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
  2222/2225  (100%)|    0:05/    0:05|    0:05/    0:05|   10.769x|    0:00
average: 128.0 kbps   LR: 22 (0.9888%)   MS: 2203 (99.01%)

Writing LAME Tag...done


I have set realplayer to esound output.

I noticed that in realplayer it says that esdmon must be running but I see the script both starts and stops esdmon.

Puggy
Back to top
View user's profile Send private message
Runny
n00b
n00b


Joined: 11 Mar 2003
Posts: 19
Location: Fairfield, NJ

PostPosted: Mon Mar 31, 2003 1:41 pm    Post subject: Reply with quote

puggy wrote:
Am I being stupid here?


If you're stupid then so am I because I could never get that to work quite right. That's when I found vsound, which doesn't allow you to hear the stream when you're recording it, but it actually sounds intelligible when it's finished encoding. There is an ebuild for vsound.
Back to top
View user's profile Send private message
puggy
Bodhisattva
Bodhisattva


Joined: 28 Feb 2003
Posts: 1992
Location: Oxford, UK

PostPosted: Mon Mar 31, 2003 3:38 pm    Post subject: Reply with quote

Ok. trying to get vsound to work now...
Code:

puggy@aragorn puggy $ vsound --file=NTune.wav -v -t http://www.hyperreal.org/music/artists/orbital/visit1.ram
Output file:   NTune.wav
Temp AU file:  ./vsound15233.au
About to start the application. The output will not be available
until the application exits.
/usr/bin/vsound: line 163: http://www.hyperreal.org/music/artists/orbital/visit1.ram: No such file or directory
Missing file ./vsound15233.au.
This means that the libvsound wrapper did not work correctlty.
Here are some the possible reasons :
 - You are trying to record a stream (RTSP or PNM protocol) from
   the internet. You will need to use the --timing option.
 - The program you are trying to run is setuid. You will need to
   run vsound as root.
 - Vsound was not properly installed and hence won't work at all.


Tries running as root. no difference. Also tried a couple of other streams which had the same response. Also tried downloading the .ram file from a site and running vsound with that parameter on the offchance. but just get
Code:

root@aragorn puggy # vsound -v -t visit1.ram
Output file:   ./vsound.wav
Temp AU file:  ./vsound15274.au
About to start the application. The output will not be available
until the application exits.
/usr/bin/vsound: line 163: visit1.ram: command not found
Missing file ./vsound15274.au.
This means that the libvsound wrapper did not work correctlty.
Here are some the possible reasons :
 - You are trying to record a stream (RTSP or PNM protocol) from
   the internet. You will need to use the --timing option.
 - The program you are trying to run is setuid. You will need to
   run vsound as root.
 - Vsound was not properly installed and hence won't work at all.

with that.

Any suggestions?

Puggy
Back to top
View user's profile Send private message
Runny
n00b
n00b


Joined: 11 Mar 2003
Posts: 19
Location: Fairfield, NJ

PostPosted: Mon Mar 31, 2003 3:47 pm    Post subject: Reply with quote

puggy wrote:
Any suggestions?


Your syntax is wrong. You have to tell vsound which application to use to open your stream, and you should be able to run it as a user. In your case, the command would look something like this:

Code:
vsound --file=NTune.wav -t realplay http://www.hyperreal.org/music/artists/orbital/visit1.ram


Of course, this just outputs to wav. If you wanted to automatically convert this to an MP3 or other format, just write a script around it.
Back to top
View user's profile Send private message
puggy
Bodhisattva
Bodhisattva


Joined: 28 Feb 2003
Posts: 1992
Location: Oxford, UK

PostPosted: Mon Mar 31, 2003 4:14 pm    Post subject: Reply with quote

ahhh. I started off thinking this, but then I looked in realplayer and there was no option to choose vsound as the output so I assumed vsound must be able to open the stream as well.

Doh!

Puggy
Back to top
View user's profile Send private message
puggy
Bodhisattva
Bodhisattva


Joined: 28 Feb 2003
Posts: 1992
Location: Oxford, UK

PostPosted: Mon Mar 31, 2003 5:01 pm    Post subject: Reply with quote

Dude. This rocks. :-D

Puggy
Back to top
View user's profile Send private message
Runny
n00b
n00b


Joined: 11 Mar 2003
Posts: 19
Location: Fairfield, NJ

PostPosted: Mon Mar 31, 2003 5:04 pm    Post subject: Reply with quote

puggy wrote:
Dude. This rocks. :-D


It really does. Big kudos to the authors. The best way for doing this same thing in Windows requires buying TotalRecorder, which I did, and it works great, but free is always better. :)

-R
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum