Audacity: recording from your soundcard

I could scarcely believe that this was available.. but it certainly is. You just have to get the settings right.

My 2012 I3 laptop has the Realtek chip to be found in, well, lots of laptops:

Having downloaded and installed Audacity, make sure your settings are like this, with particular attention to the Loopback option:

May 2017: I now have a laptop with a soundcard that has no StereoMix option. However, the recording still works without touching the soundcard options in Windows. This is how my options look on the new machine. It still works:


With that done, press the red recording button, then start the audio you want to record, and you are away:

Not directly relevant, but I’m finding right now that Audacity sits for an age (e.g. 2-3 minutes) on its splash logo before starting up properly.


Sound: loopback recording

I tried code from a number of blogs in an effort to get WASAPI loopback recording working. I only succeeded with one, but that obviously is good enough. The challenge is that WASAPI has a C++ interface. The fundamentals of C++ are simple enough… but when it comes to calling unmanaged code from .Net, I struggle, and need help.

The “winner” then is this person’s Github repository , and specifically his entry on loopback-capture here.


Helpfully the .sln built fine in VS2015.

Executing it after building then consisted of going to the Debug folder. First I naively tried loopback-capture without arguments, which gave me this:


The “something bad happened” turns out to be a symptom of no active audio playback being detected.
Stepping back, you have a help option:


Listing devices gives me this:


Running the single found device, with no file name, and making sure you are currently playing audio, results in a default-named  wav file being saved to the current location. The “… spurious glitch… ” below seems to happen regardless. A packet in this context is doubtless a loss I could not even hear, although I have yet to prove that.







C#: Installing NAudio and other small steps

Up to this point, I was considering converting the NUnit tests to MsTest tests (just because I use the latter in work). However I found that there is an adapter for NUnit which is a Test Explorer test runner… and works great – see the bottom pictures:


Recording sound from your sound card

On another PC, the SoundMix option in Windows sound options was a reasonable way of recording soundcard (Realtek) output to a wav file. However, that option is not there on my current laptop, which has an NVidia soundcard. Sure I could code something myself… but it looked like the effort was greater than the reward. In the end, I used the combination of 2 pieces of paid-for software, to get a working audio file that I can put on SoundCloud to demo my musical intervals app. Those 2 software packages are:

Soundcast-o-matic, which despite the cheesy name, works great for screen recording, and has a very reasonable subscription model. This allows me to save to .avi, which is recognised by..

Sony Sound Forge Audio Studio 10.0, which though old, works fine on Windows 10… as long as you haven’t lost that precious license key. I can extract the sound from the .avi, and save it as .mp3

In ITunes, I can then add the file, attach to a playlist, specifically for the purpose of burning that to a CD.