-
capturing sound
Hello,
I'm running Slackware 12.0 and have an Asus P4P800-e motherboard with
built in sound. I want to capture sound from the network.
I connected to the sound source on the net with Firefox. Then I
disconnected the line out jack from the speakers and plugged it into
the line in jack in the computer. I gave the command
rec -d /dev/sound/audio cpt.wav
as root and I got the error message
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM /dev/sound/
audio
sox: Failed reading /dev/sound/audio: cannot open audio device
/dev/sound/audio does exist, by the way.
What did I do wrong, or is the attempt fatally flawed. Thanks in
advance.
klee12
-
Re: capturing sound
klee12 wrote:
[color=blue]
> Hello,
>
> I'm running Slackware 12.0 and have an Asus P4P800-e motherboard with
> built in sound. I want to capture sound from the network.
>
> I connected to the sound source on the net with Firefox. Then I
> disconnected the line out jack from the speakers and plugged it into
> the line in jack in the computer. I gave the command
>
> rec -d /dev/sound/audio cpt.wav
>
> as root and I got the error message
>
> ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM /dev/sound/
> audio
> sox: Failed reading /dev/sound/audio: cannot open audio device
>
> /dev/sound/audio does exist, by the way.
>
> What did I do wrong, or is the attempt fatally flawed. Thanks in
> advance.[/color]
Did you try?
rec cpt.wav
Also if you are getting the source off the Internet there are ways of
capturing the sound inside your system. mplayer can use the -dumpstream
option. You can even capture real media video if you know how it works. But
for most streaming media you can try diverting it to disk instead via a
media player, not all players have such an option.
With some of the more complicated streaming media the media program first
downloads a file that tells it where the stream actually is. To capture
video in this method I used a script that accepts the url to that file from
firefox. it then reads that file and gets the stream uri from inside it.
Then it sends that to mplayer with the -dumpstream option.
Richard James
-
Re: capturing sound
Thanks for your reply Richard James.
On Dec 5, 11:33 pm, Richard James <IWillGetOne@here> wrote:
[color=blue]
>Did you try?
> rec cpt.wav
>[/color]
Yes. I got my stream going and could hear it on the speaker. Then I
issued the above command. When I played the wav file I got silence. I
tried again, this time after the I got stream going, I disconnected
the line to the speaker and connected it to line in on the computer
and , issued the rec command. Again I got only silence.
[color=blue]
> Also if you are getting the source off the Internet there are ways of
> capturing the sound inside your system. mplayer can use the -dumpstream
> option. You can even capture real media video if you know how it works. But
> for most streaming media you can try diverting it to disk instead via a
> media player, not all players have such an option.
>[/color]
I looked at the page source, and found the url for the stream. Then I
did
mplayer [url]http://www.wsw.com/webcast/wa47/rt2/[/url]
just to see I could get sound before trying to capture it. I got the
error messages
Playing [url]http://www.wsw.com/webcast/wa47/rt2/[/url].
Resolving [url]www.wsw.com[/url] for AF_INET6...
Couldn't resolve name for AF_INET6: [url]www.wsw.com[/url]
Resolving [url]www.wsw.com[/url] for AF_INET...
Connecting to server [url]www.wsw.com[/url][66.246.249.49]: 80...
Cache size set to 320 KBytes
Cache fill: 0.25% (815 bytes)
Win32 LoadLibrary failed to load: avisynth.dll, /usr/lib/codecs/
avisynth.dll, /usr/lib/win32/avisynth.dll, /usr/local/lib/win32/
avisynth.dll
Evidently I'm missing avisynth.dll. Does anyone knows where I can get
this codec? I googled avisynth and couldn't find what I think I want.
Most of the references seemed to be for an avisynth scripting
language.
Thanks in advance for any help
klee12
-
Re: capturing sound
On 2007-12-06, klee12 <klee12@alum.mit.edu> wrote:
[color=blue]
> Playing [url]http://www.wsw.com/webcast/wa47/rt2/[/url].
> Resolving [url]www.wsw.com[/url] for AF_INET6...
> Couldn't resolve name for AF_INET6: [url]www.wsw.com[/url]
> Resolving [url]www.wsw.com[/url] for AF_INET...
> Connecting to server [url]www.wsw.com[/url][66.246.249.49]: 80...
> Cache size set to 320 KBytes
> Cache fill: 0.25% (815 bytes)
> Win32 LoadLibrary failed to load: avisynth.dll, /usr/lib/codecs/
> avisynth.dll, /usr/lib/win32/avisynth.dll, /usr/local/lib/win32/
> avisynth.dll
>
> Evidently I'm missing avisynth.dll. Does anyone knows where I can get
> this codec? I googled avisynth and couldn't find what I think I want.
> Most of the references seemed to be for an avisynth scripting
> language.[/color]
Aren't dll's for windows? I don't have any on my Slack 12.0, And there
are none in the .../slackware/l/ directory.
In order to pretend that I am being helpful here, I will suggest
that you google for those libs. That's how I find them.
Sorry,
Tom
--
simpleman.s43
That would be at gee male
-
Re: capturing sound
It appears that your sound-IN is not verified to be configured
correctly for the alsa driver.
I had a similar board ASUS P4P800-MX. Sound was OK on Slack 10 (both
IN and OUT). But on Slack 12 no sound. I had to recompile alsa-
driver-1.0.15rc with the mod that the "patch_ad1888" in <pci/ac97/
ac97_codec.c> had to be disabled, i.e., replacing the line (~111)
{ 0x41445368, 0xffffffff, "AD1888", patch_ad1888, NULL },
by
{ 0x41445368, 0xffffffff, "AD1888", NULL, NULL },
This made the sound OUT work, but on the wrong connector.
Later playing with the patch_ad1888, I was able to make sound-IN work,
but this got mapped on to the same connector as sound-OUT. I did not
spend enough time to get both sound IN and OUT right at the same time.
On Dec 5, 1:56 pm, klee12 <kle...@alum.mit.edu> wrote:[color=blue]
> Hello,
>
> I'm running Slackware 12.0 and have an Asus P4P800-e motherboard with
> built in sound. I want to capture sound from the network.
>
> I connected to the sound source on the net with Firefox. Then I
> disconnected the line out jack from the speakers and plugged it into
> the line in jack in the computer. I gave the command
>
> rec -d /dev/sound/audio cpt.wav
>
> as root and I got the error message
>
> ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM /dev/sound/
> audio
> sox: Failed reading /dev/sound/audio: cannot open audio device
>
> /dev/sound/audio does exist, by the way.
>
> What did I do wrong, or is the attempt fatally flawed. Thanks in
> advance.
>
> klee12[/color]
-
Re: capturing sound
On Dec 6, 2:33 am, Richard James <IWillGetOne@here> wrote:[color=blue]
> klee12 wrote:[color=green]
> > Hello,[/color]
>[color=green]
> > I'm running Slackware 12.0 and have an Asus P4P800-e motherboard with
> > built in sound. I want to capture sound from the network.[/color]
>[color=green]
> > I connected to the sound source on the net with Firefox. Then I
> > disconnected the line out jack from the speakers and plugged it into
> > the line in jack in the computer. I gave the command[/color]
>[color=green]
> > rec -d /dev/sound/audio cpt.wav[/color]
>[color=green]
> > as root and I got the error message[/color]
>[color=green]
> > ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM /dev/sound/
> > audio
> > sox: Failed reading /dev/sound/audio: cannot open audio device[/color]
>[color=green]
> > /dev/sound/audio does exist, by the way.[/color]
>[color=green]
> > What did I do wrong, or is the attempt fatally flawed. Thanks in
> > advance.[/color]
>
> Did you try?
> rec cpt.wav
>
> Also if you are getting the source off the Internet there are ways of
> capturing the sound inside your system. mplayer can use the -dumpstream
> option. You can even capture real media video if you know how it works. But
> for most streaming media you can try diverting it to disk instead via a
> media player, not all players have such an option.
>
> With some of the more complicated streaming media the media program first
> downloads a file that tells it where the stream actually is. To capture
> video in this method I used a script that accepts the url to that file from
> firefox. it then reads that file and gets the stream uri from inside it.
> Then it sends that to mplayer with the -dumpstream option.
>
> Richard James[/color]
isn't it possible to do the mapping (pcm-out to capture) in kmix?
-
Re: capturing sound
On Dec 6, 3:34 am, klee12 <kle...@alum.mit.edu> wrote:[color=blue]
> Thanks for your reply Richard James.
>
> On Dec 5, 11:33 pm, Richard James <IWillGetOne@here> wrote:
>[color=green]
> >Did you try?
> > rec cpt.wav[/color]
>
> Yes. I got my stream going and could hear it on the speaker. Then I
> issued the above command. When I played the wav file I got silence. I
> tried again, this time after the I got stream going, I disconnected
> the line to the speaker and connected it to line in on the computer
> and , issued the rec command. Again I got only silence.
>[color=green]
> > Also if you are getting the source off the Internet there are ways of
> > capturing the sound inside your system. mplayer can use the -dumpstream
> > option. You can even capture real media video if you know how it works. But
> > for most streaming media you can try diverting it to disk instead via a
> > media player, not all players have such an option.[/color]
>
> I looked at the page source, and found the url for the stream. Then I
> did
>
> mplayerhttp://www.wsw.com/webcast/wa47/rt2/
>
> just to see I could get sound before trying to capture it. I got the
> error messages
>
> Playinghttp://www.wsw.com/webcast/wa47/rt2/.
> Resolvingwww.wsw.comfor AF_INET6...
> Couldn't resolve name for AF_INET6:[url]www.wsw.com[/url]
> Resolvingwww.wsw.comfor AF_INET...
> Connecting to serverwww.wsw.com[66.246.249.49]: 80...
> Cache size set to 320 KBytes
> Cache fill: 0.25% (815 bytes)
> Win32 LoadLibrary failed to load: avisynth.dll, /usr/lib/codecs/
> avisynth.dll, /usr/lib/win32/avisynth.dll, /usr/local/lib/win32/
> avisynth.dll
>
> Evidently I'm missing avisynth.dll. Does anyone knows where I can get
> this codec? I googled avisynth and couldn't find what I think I want.
> Most of the references seemed to be for an avisynth scripting
> language.
>
> Thanks in advance for any help
>
> klee12[/color]
This is a generic mplayer error it throws out when it cannot handle a
media (or the address does not really point to a media file). It does
not need this dll.
For firefox you need to get some kind of plugin (mozdev) which will
allow mplayer to be activated. Then on the FireFox context menu (right-
click) "view info" you can get the correct address of the media file.
This correct address can be fed to mplayer on the command line (or
some other media player).
--
-
Re: capturing sound
klee wrote :
[color=blue]
> mplayer [url]http://www.wsw.com/webcast/wa47/rt2/[/url]
>[/color]
MPlayer can only play files, not web-addresses. If you open the site in
a browser youll see a login site.
When you come up with the correct URL to the file then you can use the
'-dumpstream' option and MPlayer will dump the stream to ./stream.dump
[color=blue]
> just to see I could get sound before trying to capture it. I got the
> error messages
>[/color]
They are just bogus messages telling you that MPlayer cant find the
file.
--
Thomas O.
This area is designed to become quite warm during normal operation.
-
Re: capturing sound
On Thu, 06 Dec 2007 18:51:23 +0100, Thomas Overgaard wrote:
[color=blue]
> klee wrote :
>[color=green]
>> mplayer [url]http://www.wsw.com/webcast/wa47/rt2/[/url]
>>[/color]
> MPlayer can only play files, not web-addresses. If you open the site in
> a browser youll see a login site.[/color]
Has anybody mentioned streamtuner? That can play streams from the
net and can record a stream with a mouse click or two.
-
Re: capturing sound
Thanks to all who replied. I think I've got something now, using the
info on this post. Here's what I did:
1. started the stream (e.g ([url]http://www.wsw.com/webcast/wa47/rt1[/url])
2. right clicked, clicked on media, and placed a file name of the
stream
-
Re: capturing sound
Ooops hit wrong button accidently. Let me continue from previous
message.
2. right clicked, clicked on media, and placed the file name of the
stream (e.g. audio.asx?0.524562228738112) on xclipboard
3. produced a url from concatenating the URL of the stream and the
file above (e.g.
[url]http://www.wsw.com/webcast/wa47/rt1/audio.asx?0.524562228738112[/url]
and did a wget on that url. The wget produces a file which contains
several urls (e.g [url]http://66.246.249.37/wa47.rt1.wma[/url])
4. used mplayer to capture the stream from the above url (e.g.
mplayer -dumpstream -dumpfile rt1.wav [url]http://66.246.249.37/wa47.rt1.wma[/url]
)
That works, more or less. However I can only play the captured file
with mplayer; when I tried with audacious or play, I got various error
messages.
The above is kind of awkward. Recompiling the alsa driver with a patch
is probably the best thing to do, but that's a lot of work for me. I
looked at streamtuner but that seems to be designed only for radio.
Thanks to again to everyone for their replies
klee12
-
Re: capturing sound
klee wrote :
[color=blue]
> mplayer -dumpstream -dumpfile rt1.wav [url]http://66.246.249.37/wa47.rt1.wma[/url]
>
> That works, more or less. However I can only play the captured file
> with mplayer; when I tried with audacious or play, I got various error
> messages.[/color]
I'm pretty sure thats because MPlayer doesn't convert the file from wma to
wav this way, use the file command to check. If you want a wav file then
you can get one this way:
mplayer rt1.wav -ao pcm:file=rt1-new.wav
Maybe you'll have to rename the downloaded file to rt1.wma first.
--
Thomas O.
This area is designed to become quite warm during normal operation.
-
Re: capturing sound
On Fri, 07 Dec 2007 20:41:44 +0100, Thomas Overgaard wrote:
[color=blue]
> klee wrote :
>[color=green]
>> mplayer -dumpstream -dumpfile rt1.wav [url]http://66.246.249.37/wa47.rt1.wma[/url]
>>
>> That works, more or less. However I can only play the captured file
>> with mplayer; when I tried with audacious or play, I got various error
>> messages.[/color]
>
> I'm pretty sure thats because MPlayer doesn't convert the file from wma
> to wav this way,[/color]
That's quite certain!
[color=blue]
> use the file command to check. If you want a wav file
> then you can get one this way:
> mplayer rt1.wav -ao pcm:file=rt1-new.wav[/color]
Can be a way, but it may depend of different transfer conditions,
I used to do it through a fifo that'd get rid of most possible
buffer under/over filling problems.
The safest way is still to get it 'raw', like the OP did with
the '-dumpstream -dumpfile xxx' and not pretend to believe it will
be RiffWav just because of the extension (mplayer is NOT sox) ;-)
[color=blue]
>
> Maybe you'll have to rename the downloaded file to rt1.wma first.[/color]
that'd be the way for the user to remember that "wav" isn't a
RiffWav :-)
You also may convert the file from asf to wav with
appropriate tools if any.
In the case of the OP's given example (rt1.wma) I just checked and
it is clear for mplayer that's an ASF audio stream:
-------------
Playing [url]http://66.246.249.37/wa47.rt1.wma[/url].
Connecting to server 66.246.249.37[66.246.249.37]: 80...
STREAM_ASF, URL: [url]http://66.246.249.37/wa47.rt1.wma[/url]
-------------
and in the end:
------------
$ file rt1.wav
rt1.wav: Microsoft ASF
------------
-
Re: capturing sound
Thanks again all for your comments. I'm not sure why I assumed that
the dumped file would be a wav file, but I should have checked.
Still, this method is awkward at best, and works for this given type
of audio stream. If I go to another site, I might have to do something
different to get the name of the stream. I'm thinking of getting a
MacIntosh laptop and that might solve my problems.
klee12
-
Re: capturing sound
On Sat, 08 Dec 2007 01:39:57 -0800, klee12 wrote:
[color=blue]
> Thanks again all for your comments. I'm not sure why I assumed that the
> dumped file would be a wav file, but I should have checked.
>
> Still, this method is awkward at best, and works for this given type of
> audio stream. If I go to another site, I might have to do something
> different to get the name of the stream. I'm thinking of getting a
> MacIntosh laptop and that might solve my problems.[/color]
or just do the sane thing and ignore streaming pushers...
-
Re: capturing sound
klee wrote :
[color=blue]
> I'm thinking of getting a MacIntosh laptop and that might solve my
> problems.[/color]
I would definitely ask a Mac group first. But I doubt its any easier
because from those webmasters point of view you're not supposed to do
what you want to do.
--
Thomas O.
This area is designed to become quite warm during normal operation.
-
Re: capturing sound
klee12 wrote:
[color=blue]
> Ooops hit wrong button accidently. Let me continue from previous
> message.
>
> 2. right clicked, clicked on media, and placed the file name of the
> stream (e.g. audio.asx?0.524562228738112) on xclipboard
>
> 3. produced a url from concatenating the URL of the stream and the
> file above (e.g.
>
> [url]http://www.wsw.com/webcast/wa47/rt1/audio.asx?0.524562228738112[/url]
>
> and did a wget on that url. The wget produces a file which contains
> several urls (e.g [url]http://66.246.249.37/wa47.rt1.wma[/url])
>
> 4. used mplayer to capture the stream from the above url (e.g.
>
> mplayer -dumpstream -dumpfile rt1.wav [url]http://66.246.249.37/wa47.rt1.wma[/url]
> )
>
> That works, more or less. However I can only play the captured file
> with mplayer; when I tried with audacious or play, I got various error
> messages.[/color]
As others have said that is because mplayer does not convert the file to
wav, it downloads it raw as an ASF for your stream. What follows is my
script that I select from firefoxes open file with program dialog.
Note you would have to alter it somewhat to your liking. You can easily
change the download directory twd. The sed lines just alter the url so I
can get a proper file saved instead of temp.rm or stream.dump. The watch
and Konsole lines are there to watch the progress of the download, since it
is streaming there is nothing stored in the stream about the size, I just
wait until mplayer stops.
#!/usr/bin/bash
# function for passing variables to commands
p() { printf '%s\n' "$@"; }
# the working directory
twd=~/Desktop/Lectures
# download the temp real media file and then extract the destination string
out of it
remote_file=`cat $1`
# copy the remote file to the destination file so we can alter the string
local_file=$remote_file
# trim the start and the end of the local_file
# starting with
# rtsp://169.229.131.16:554//classes/f2007/cs162/20070827.rm?start=0:00&end=
local_file=`p "$local_file" | sed -e 's/\?.*//'`
# local file should now look like
# rtsp://169.229.131.16:554//classes/f2007/cs162/20070827.rm
# remove the ?start=0:00&end= from the remote file too
remote_file=$local_file
# remove the beginning of the local file
local_file=`p "$local_file" | sed -e 's/^.*\/\///'`
# local file should now look like
# classes/f2007/cs162/20070827.rm
# convert the slashes to dashes
# classes/f2007/cs162/20070827.rm to classes-f2007-cs162-20070827.rm
local_file=`p "$local_file" | sed -e 's/\//-/g'`
# add the working directory to the local_file
local_file=$twd/$local_file
# dump the stream with mplayer
# mplayer -dumpstream
#rtsp://169.229.131.16:554//classes/f2007/cs162/20070827.rm -o
#cs162-20070827.rm
echo "mplayer -dumpstream $remote_file -dumpfile $local_file" >
$twd/progress
mplayer -dumpstream $remote_file -dumpfile $local_file >> $twd/progress &
# wait for the download to take place
sleep 60s
# watch the download progress in a konsole
konsole -e watch "cat $twd/progress ; echo ; echo ; du $local_file -sh0 |
sed -e 's/\/.*//' ; du $local_file -s"
############## End Of Script ###########################
Richard James
-
Re: capturing sound
On Dec 5, 1:56 pm, klee12 <kle...@alum.mit.edu> wrote:[color=blue]
> Hello,
>
> I'm running Slackware 12.0 and have an Asus P4P800-e motherboard with
> built in sound. I want to capture sound from the network.
>
> I connected to the sound source on the net with Firefox. Then I
> disconnected the line out jack from the speakers and plugged it into
> the line in jack in the computer. I gave the command
>
> rec -d /dev/sound/audio cpt.wav
>
> as root and I got the error message
>
> ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM /dev/sound/
> audio
> sox: Failed reading /dev/sound/audio: cannot open audio device
>
> /dev/sound/audio does exist, by the way.
>
> What did I do wrong, or is the attempt fatally flawed. Thanks in
> advance.
>
> klee12[/color]
If the sound being played on the speakers is all that you want to
record, this turns out to be quite simple. In "aumix", configure "Rec"
checkbox to be besides "level" (this checkbox will be red). Now when
something is being played on the speakers, in a terminal do:
$ arecord > myrec.wav
Stop with Ctrl-C whenever you want. The recorded file can be played
as
$ aplay myrec.wav
-
Re: capturing sound
klee12 wrote:
[color=blue]
> Thanks again all for your comments. I'm not sure why I assumed that
> the dumped file would be a wav file, but I should have checked.
>
> Still, this method is awkward at best, and works for this given type
> of audio stream. If I go to another site, I might have to do something
> different to get the name of the stream. I'm thinking of getting a
> MacIntosh laptop and that might solve my problems.[/color]
I somehow doubt that a Mac has the software to do this. I think that Linux
is the best OS for this since it has the tools to do it. The main problem
is that these people don't want you to download their streams and they will
continue to make problems for those of us who don't use streams in that
fashion. I don't download a stream to break copyright law. I download it
because I don't want to sit at my computer and download and watch video. My
time is not partitioned in a way to make it easy for me to do that.
I think a better solution to this problem is a smarter script. One that can
autodetect things like the stream type and use dialogs to guide the user.
Where do you want to download it? What do you want to call the download? Do
you want to post-recode it from say ASF to OGG-VORBIS, or from rm to
AVI-XVID?
Such a script is possible, it just takes some time(weeks[0]) to develop it.
I don't need such a script as I am not a heavy user of downloadable streams,
yet.
Richard James
[0] Not calculated in man hours but realistic hours based on my other life
priorities. Would only take a day or two normally if I worked straight. But
I can't justify the time.
-
Re: capturing sound
Den Sat, 08 Dec 2007 18:46:55 -0800 skrev jessbody:
[color=blue]
> On Dec 5, 1:56 pm, klee12 <kle...@alum.mit.edu> wrote:[color=green]
>> Hello,
>>
>> I'm running Slackware 12.0 and have an Asus P4P800-e motherboard with
>> built in sound. I want to capture sound from the network.
>>
>> I connected to the sound source on the net with Firefox. Then I
>> disconnected the line out jack from the speakers and plugged it into
>> the line in jack in the computer. I gave the command
>>
>> rec -d /dev/sound/audio cpt.wav
>>
>> as root and I got the error message
>>
>> ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM /dev/sound/
>> audio
>> sox: Failed reading /dev/sound/audio: cannot open audio device
>>
>> /dev/sound/audio does exist, by the way.
>>
>> What did I do wrong, or is the attempt fatally flawed. Thanks in
>> advance.
>>
>> klee12[/color]
>
> If the sound being played on the speakers is all that you want to
> record, this turns out to be quite simple. In "aumix", configure "Rec"
> checkbox to be besides "level" (this checkbox will be red). Now when
> something is being played on the speakers, in a terminal do:
>
> $ arecord > myrec.wav
>
> Stop with Ctrl-C whenever you want. The recorded file can be played as
>
> $ aplay myrec.wav[/color]
I'am not an Slackware user but to get my system to capture anything from
the sound card I had to install the esd sound server.
To see if you need it run 'vumeter -r &' (with out the ') if the vumeter
start to work than the only ting you need is to configuring alsa, eg turn
on the mic/line in or similar. If the vumeters not working or if you get
an error-message then you probably need esd eg, 'pulseaudio-esound-
compat' and 'esound'. after install try 'vumeter -r &' (with out the ')
again to see if it start to function. I use the alsa server with esd and
I can manage to capture the sound from PCM, but it can be differ for
other sound cards so probably you have to try to capture from some of the
other signals eg line in/mic etc.
If this not help then please ignore this
/Anders