-   Linux - Software (
-   -   Capture sound from soundcard - tutorials are close but not quite (

tensigh 08-13-2009 06:48 PM

Capture sound from soundcard - tutorials are close but not quite

I'm running Ubuntu Intrepid Ibid running kernel 2.6.27-14-generic on a Toshiba laptop. I'm trying to capture sound from a radio broadcast from NHK here in Japan and I can't quite get it. The broadcast is initiated from a Flash object so I can't use streamripper.

I can open PulseAudio volume controls in Gnome and I switched my input source in PulseAudio Device Controller to 'Monitor Source of ALSA PCM on front:0 (CONEXANT Analog) via DMA' and I can see the sound output in Gnome. When I try to record from arecord I'm still getting a blank file with no sound.

How do I tell arecord how to use the monitor driver?


mushroomboy 08-13-2009 07:31 PM

One person mentions a simple solution... Route autio out to autio in, physical route. Simple yet...Well yet ugly.

jlinkels 08-13-2009 10:44 PM

If I understand well, you have sound on Line In, and you want to capture that to a file, correct?

If you are using arecord, issue these commands first:


/usr/bin/amixer -c 0 sset 'Line',0 100%,100% mute  capt
/usr/bin/amixer -c 0 sset 'PCM',0 100%,100% unmute  nocap

-c 0 is your first audio card, -c 1 the second one, etc.

After you issued these commands, do:


arecord -r 8 -D plughw:0,0
(You might want to do arecord -L to list your audio devices, I always forget how to address them, but plughw is generic)

If you see mainly '{' and '|' characters on your screen, you are NOT capturing any sound. But that is unlikely.

If you see the screen full of garbage, you are capturing.

So choose a sample rate, resolution and pipe the output in your file:

arecord -f CD -D plughw:0,0 > myaudiofile.wav
Not that these files are uncompressed and grow large quickly.


All times are GMT -5. The time now is 01:41 PM.