[Howto] Record soundcard output with Audacity in KDE [Update: and Gnome]

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:

audacity start monitoring

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:

kmix with activated mixer switch

Now check in Audacity if you get a good signal:

Audacity with active input monitoring

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.

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).”


17 thoughts on “[Howto] Record soundcard output with Audacity in KDE [Update: and Gnome]”

  1. 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).

  2. 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.


  3. 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.

  4. 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.

  5. 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).

  6. 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.

  7. 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.

  8. Thanks a lot for this tutorial! I use Audacity on Windows but I’ve managed to do the same! I used to think you always needed extra software to do this trick, now I know it’s not the way :d

  9. most humans only hear up to 22050 Hz of any audio waveform at most, so 44100 should be enough of a sample rate to ‘capture’ the audible data. There might be some ‘ambience’ you lose in not going with 96000hz, but the ‘perceptible’ data should still all be there.

  10. Thanks for your manual, but it doesn’t work on my entire system. I am using Kubuntu 8.04.1 on a notebook Samsung R60 which has an “ATI Technologies Inc SBx00 Azalia” sound chip. If I am not mistaken, it looked to Windows as SoundMAX High Definition Audio. I have no such a switch neither in KMix window, nor in alsamixer, etc. Is my driver bad (it’s the one which was bundled) or anything else?

  11. .kkursor, can’t help you there. The best is to ask at a *buntu forum if they can help you to properly set up your sound hardware. Or maybe the switch just has a different name for your soundcard?
    You might also ask at a alsa forum/mail-list why your card/driver does not has the switch.

  12. Thanks a lot for this great manual. It works perfectly and also i have been surprised how it is simple to do this job in Gnu/Linux.
    In Gnome just open Volume Control and choose Mix And Capture from menu Edit->Preferences. Then put the volume of capture on very low and PCM on medium to high.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.