LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to Capture Streaming Audio (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-capture-streaming-audio-626876/)

MooseMagnet 03-09-2008 06:54 PM

How to Capture Streaming Audio
 
I've tried streamripper, XMMS, streamtuner. Can't figure out how to grab an audio stream. If the dang thing goes through my processor and sound card, I should be able to grab it.

How do I capture and audio stream?

Thanks, and sorry to re-post, but the question morphed.

ncsuapex 03-09-2008 07:02 PM

capture from line in

sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - ~/filename.mp3



record from internet stream

mplayer -dumpstream -dumpfile ~/filename.mp3 mms://location/to/stream

MooseMagnet 03-09-2008 08:13 PM

Got that. Now, how do I find the location of the stream?

Not to sound ungrateful, but the reason I post to the Newbie thread, is because I am a Newbie. I don't understand most of what you tell me. If you can be more specific, I will greatly appreciate it. Please don't take offense from my frustration.

MooseMagnet 03-10-2008 02:28 PM

Figured out part of it
 
I've been able to capture some streams with streamripper. YEA!!
But I must know the URL 12.123.23.45.... Doesn't seem to be a single simple way of seeing the url on all sites.

Advice?

Thanks

ncsuapex 03-10-2008 02:30 PM

I can't remember how exactly I got the mms.. but i *think* you just do a wget on the page where the stream is then browse the file for mms or anything else that resembles a URL. Then copy/paste it in a browser or use "mplayer url" to make sure the stream plays and it's not a pre-recorded ad.

glidermike 03-10-2008 02:56 PM

record from stream
 
If you are using streamtuner you can easily rip to your hd using streamripper. If you want to rip random streams from within a browser you can install the downloadhelper extension in firefox and it will rip almost anything including video! I have also used KRec recording tool (kde) it works really well.

matthewg42 03-10-2008 04:49 PM

If your audio application is playing using the ALSA driver, you can simple enable the capture input in alsamixer, and then use and ALSA recording program to capture whatever you are playing. I tend to use arecord (the command line ALSA utility) for this, but you could also use a GUI app which can use the ALSA driver.

MooseMagnet 03-10-2008 05:37 PM

Okay. Matthew, your suggestion seems the simplest. I've tried it a few different ways, but can't get anything to record.

Are you saying I should right-click the speaker icon and change it from Master to Capture? I've done that, and some other things. Then I used SoundRecorder. It records, but no sound is heard when I play it back.

I understand some of what you're suggesting, but not enough to be successful.

matthewg42 03-10-2008 05:39 PM

I wrote it up for recoding skype conversations, here:

http://porpoisehead.net/hi/?q=node/23

It might be a little out of date with version numbers and the like, but the process should still be much the same.

Ryptyde 03-10-2008 07:18 PM

I use streamtuner, streamripper and vlc enabled for the media player currently with Fedora 8 and previously with other Fedoras. When I have streamtuner running the gui has "Tune In,Record,Browse" in the top menu lit up "green" and while listening to audio I click on "Record" and streamripper begins recording to a directory in "home".

ncsuapex 03-11-2008 06:15 AM

I like mplayer because I can SSH into my box from work/etc and set it up to record or can use cron to run a script that can record if I'm not around.

andrew.46 03-11-2008 05:07 PM

Hi,

Often an easy way to get around the problem of finding the exact location of the sound stream is to use the -playlist option of mplayer. Below is an example that uses my favourite radio broadcast on Australian radio and saves it to a file called ftgws.wav:

Code:

$ mplayer -playlist \
        http://www.abc.net.au/classic/ftgws/audio/ftgws_09032008.ram \
        -vc null -vo null -ao pcm:fast:waveheader:file=ftgws.wav

(For anyone reading this as an 'old post' bear in mind that this file will be active only for a month at this address.) And if you look closely at the actual ram file by using wget and opening the ram file with a text editor:

Code:

$ wget http://www.abc.net.au/classic/ftgws/audio/ftgws_09032008.ram
you will see that the real address of the stream is:

rtsp://media1.abc.net.au/classic/ftgws/ftgws_0903_2856ISDN2LAN1.rm

You can test this by opening this address directly with mplayer:

Code:

$ mplayer rtsp://media1.abc.net.au/classic/ftgws/ftgws_0903_2856ISDN2LAN1.rm
This does not work with all streams as some sites go to sickening lengths to shield the location of their precious files. Sigh .....

Andrew

rosspy 03-11-2008 06:49 PM

Try audacity for recording audio strems.
You just have to choose witch source to record (mix, aux, vol) but it worked out of the box for me.
After recording you just export the stream to whatever format you like, mp3, ogg, wav..

MooseMagnet 03-12-2008 08:27 PM

Wow. Thank you for all the suggestions.

I can't do it with Audicity or SoundRecorder. I've tried all the possible Capture, Capture Mux, IEC958, Front, etc. combinations. Audacity does nothing, and SoundRecorder "says" it's recording. But nothing plays back.

I poke around and find a possible URL, and use streamripper. Then get ad infinitum of this:

[re-connecting..] - [ 9kb]
[re-connecting..] - [ 9kb]
[re-connecting..] - [ 9kb]
[re-connecting..] - [ 9kb]

When I give up after more than 10 minutes and stop it, it writes an "incomplete" mp3 file in my home folder. That file won't play.

Andrew: "This does not work with all streams as some sites go to sickening lengths to shield the location of their precious files. Sigh ....."

Maybe that's what I'm up against. Not sure.

No luck with anything yet. How do the rest of you get Audacity and SoundRecorder to work? I'm using and HDAintelSTAC90 sound card. I'll keep trying. Thanks again for the help.

ncsuapex 03-12-2008 09:17 PM

post the website you are trying to get the stream from or send it to me in a private message and I'll see if I can record from it.


All times are GMT -5. The time now is 02:32 AM.