I was looking at the docs for the WASAPI ActivateAudioInterfaceAsync()
function and it mentions passing DEVINTERFACE_AUDIO_CAPTURE
as deviceInterfacePath
to activate the interface on the default audio capture device. That seems like a good practice since the MediaDevice::GetDefaultAudioCaptureId(AudioDeviceRole::Default)
call I would otherwise make to get the deviceInterfacePath
parameter (which is used in the WASAPI sample) is synchronous - even though it may take a few seconds in some cases, blocking the UI thread and potentially getting your app to be killed.
Unfortunately the docs don't show a sample, especially for how to pass the GUID as the LPCWSTR deviceInterfacePath
to ActivateAudioInterfaceAsync
.
How can I do it?