
LOOPBACK DEVICES WINDOWS
If your audio adapter contains a hardware loopback device, you can use the Windows multimedia control panel, Mmsys.cpl, to designate the device as the default capture device. (You can also use a legacy audio API, such as the Windows multimedia waveInXxx functions, to capture the stream from the device.)
LOOPBACK DEVICES CODE
Thus, if an adapter supports a loopback device, an audio application can record from the device in the same way that it records from any other capture device.įor example, if you select a hardware loopback device to be the default capture device, you can use the RecordAudioStream function (without modification) in the code example in Capturing a Stream to capture the stream from the device. The lack of standardized names might cause users to have difficulty identifying a loopback device in a list of device names.Ī hardware loopback device is a capture device.


Some hardware vendors implement loopback devices (as opposed to pin instances on render devices) in their audio adapters. When the hardware does not support a loopback pin, WASAPI copies the output stream from the audio engine into the loopback application's capture buffer, in addition to copying the audio data to the hardware's render pin. If the hardware supports a loopback pin on the render endpoint, WASAPI uses the audio provided on this pin for the loopback stream. The implementation of loopback by WASAPI depend on the capabilities of the hardware.

Exclusive-mode streams cannot operate in loopback mode.
LOOPBACK DEVICES WINDOWS 10
In Windows 10 versions 1703 and higher, event-driven loopback clients are supported, and no longer need the workaround involving the render stream.Ī client can enable loopback mode only for a shared-mode stream (AUDCLNT_SHAREMODE_SHARED). Each time the client receives an event for the render stream, it must signal the capture client to run the capture thread that reads the next set of samples from the capture endpoint buffer. To work around this, initialize a render stream in event-driven mode. In versions of Windows prior to Windows 10 1703, pull-mode capture client does not receive any events when a stream is initialized with event-driven buffering and is loopback-enabled. In the call to the IAudioClient::Initialize method, change the value of the second parameter ( StreamFlags) from 0 to AUDCLNT_STREAMFLAGS_LOOPBACK.

