Howto: Record soundcard output with Audacity in KDE [Update: and Gnome]
May 7, 2007 — liquidat
This short howto will show how to record the soundcard output on Linux with Audacity while running in KDE.
Before we start, one honest word: generally, I have no idea about audio routing on Linux. So to an expert this method might look very childish or just plain cumbersome - still, it is the only I figured out for the given task. Also, it worked here, but it might not work for you when you have another soundcard or whatever.
The task
The given task was in this case: record the output of a flash streaming online radio. In principle this shouldn’t be difficult because the data are on your computer - you just have to route them through a recording tool.
However, this is the point which is a bit odd: how do you route sound? And, also difficult at least on KDE, which recording tool can you use? I never really understood krec, so that was out of question. Also, it seems to require artsd, which infers with the flash plugin which uses Alsa.
The first solution I found didn’t work out: the man page of asound gives code snippets to do this task. However, it didn’t work for me, and the net was only full with people where it didn’t work either, so no chance there.
Also, jack might can accomplish such tasks, but I haven’t tried that.
The solution
So I checked for audacity - luckily, Fedora comes along with the newest beta of audacity which already include Alsa support - the old Audacity was OSS only which is certainly not helpful in such cases. So if you want to follow this hoto you need an Alsa supporting version of Audacity (v. 1.3.x).
Once you started Audacity, you should turn on the record signal to see if the record channel gets a signal or not:
If you have done so you can see all the time if the software gets the signal or not. This is very helpful in case you have to play around with the different in- and outputs of the mixer.
Start now any kind of audio source, and see if you have a signal there - if yes, record it and say something in the microphone at the same time. Listen to it - if you hear your own voice, then you simply record your microphone (which is quite likely).
But we want to record directly from the output. Therefore we route the sound with kmix: Open the kmix window and open the tab switches. There, activate a switch called “Mixer” by clicking the red light on top of the switch:
Now check in Audacity if you get a good signal:
If you see a strong signal, record it and speak into your microphone at the same time - you should not hear your own voice at playback.
And that’s all you have to do. The biggest disadvantage at the moment seems to be that Audacity can only record in plain data instead of live coding into OGG/mp3 - and that you start a full blown audio editor just to record some data.
Still, it works, and audacity is very easy to understand and handle. Therefore, enjoy it.
Update
Thankfully E@zyVG covered this post as well and there Gavin mentioned in a comment how to reach the same goal in Gnome:
“Instead of opening kmix, go to the sound icon in the panel and right click it, choosing “Open Volume Control”.
Under the Switches tab, you’ll find a “mix” checkbox and a “mono mix” checkbox. These are equivalent to the mixer button in kmix (only one is mono).”

September 4, 2007 at 20:16
When recording change audacity’s default settings, to record at 96000hz instead of 44000hz otherwhise the quality will suffer (to record anyting in digital you need to record at least the double of the original wave frecuency).
September 30, 2007 at 15:56
I really want to thank you for this post, helped me for finding a Workaround for Flatcast Streamer.
The finished Solution is here:
http://jans-weblog.de/index.php/2007/09/30/howto-stream-with-flatcast-and-linux/
So long
http.refresh
October 11, 2007 at 0:32
[...] a look at this too http://liquidat.wordpress.com/2007/05/07/howto-record-soundcard-output-with-audacity-in-kde/ although i’m afraid (though it doesn’t mention that) it only works with soundcards [...]
December 3, 2007 at 7:15
Hi, thanks for this tutorial, but I am not sure how this works for you…
For example, when I turn on “mix” I get a horrible high pitched squeal.
Can you give a screenshot of what your input tab looks like in kmixer. The input tab is complicated and there are many options that can be checked or un-checked.
If you have any ideas about why I am getting this high pitched sound and more importantly how to fix this problem, I would greatly appreciate any help.
Thanks!
December 3, 2007 at 11:30
Lee, the problem might be that you use a different set of hardware than me. In that situation the best would be to ask in a Forum where it is easier to discuss such matters.
December 6, 2007 at 8:10
thx dude, I’m running Gnome & the combo of Audacity & Kimx works great.
Latitude D600: Ubuntu 7.10 Gusty
March 20, 2008 at 7:16
I know this post is a little old, but I hope people are still into talking about this….
I got audacity to record the sound card ok, however the quality is diminished. So, it works, thats good, but there has got to be a way so that the audio quality isn’t diminished so much. I mean, it never leaves the computer so, there shouldn’t be any sound quality loss, right. Or, is that assumption false?
Another issue is that the mix selection doesn’t stay selected for me. I’ll stop the recording, start a new one and find myself resetting the mix input in KMix. Is anyone having this problem too? Maybe it’s time for another “apt-get upgrade”, I dunno.
March 20, 2008 at 7:26
After tweaking with the audacity preferences some more I’m beginning to hear noticeable improvements in sound quality. I think thats all it’s going to take (fingers crossed).
April 11, 2008 at 16:14
Thought I post a recent experience just from yesterday. I recorded the audio from a flash stream and the speed was about in my mind seemed about 8% slower that the stream … The song was supposed to be 4:10 and once audacity finished the recording the song was now over 5:00. I tried adjusting down to 16-bit rate not luck. I did happen to stumble on the change speed/tempo effects and bumped the ratio up to 10.92 and that fixed the tempo and all is GOOD!
Thanks for getting me to the point to just being able to record the stream.
April 29, 2008 at 18:52
Thanks a lot for this post. I had been agonizing over how to get Audacity to record, especially since the sound recorder in Ubuntu seemed to have no trouble. By the way, in Ubuntu the option for mix and mix mono is not under the Switches tab for me. I had to go to Edit>Preferences and select mix and mix mono from there.
May 1, 2008 at 0:04
[...] By Josh | April 30, 2008 I’ve written posts before on how to get audacity to work on Ubuntu. I went through a lot of trouble with getting it to record audio streaming from the internet a long time ago. I had to get alsa running, and then make sure that the browser was running first, etc. It was way too much of a hasle to go through, but luckily I found a way to easily do this. I’m on Ubuntu 8.04, but there is also a way to do this with KDE. You can find more info about that here. [...]
May 3, 2008 at 16:05
[...] Howto: Record soundcard output with Audacity in KDE [Update: and Gnome] « /home/liquidat A great post on how to get Audacity recording soundcard output on KDE or Gnome. I had no trouble with recording sound with Ubuntu’s sound recorder, but when I tried Audacity, it didn’t work. This is an easy fix. [...]