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.

SoundCardCaptureB01

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:

SoundCardCaptureB04.PNG

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

SoundCardCaptureB05.PNG

Listing devices gives me this:

SoundCardCaptureB06

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.

SoundCardCaptureB07

SoundCardCaptureB08

QED

 

 

 

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s