How to capture the system sound output, but not the microphone?

Windows

Idea copied from here.


On the volume tray icon, right click and select "Recording Devices"

Mathematica graphics

Mathematica graphics

Be sure that disabled devices are listed. Tick "Show Disabled Devices"

Mathematica graphics

You may have a device called "Stereo Mix" , "What U Hear" or "Rec. Playback". Enable the device if it is disabled. Now check that is listed in $AudioInputDevices, and notice the position of the device in the list.

TableForm[$AudioInputDevices, TableHeadings -> Automatic]

Mathematica graphics

Now you can specify the device using AudioInputDevice

AudioCapture[
 "test.ogg"
 , AudioInputDevice -> $AudioInputDevices[[2]] 
 , Appearance -> "Detailed"
 , SampleRate -> Automatic
 ]

Mathematica graphics