[wdmaudiodev] Re: [EXTERNAL] Virtual Audio Driver: Interacting with user-space application

  • From: "Matthew van Eerde" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "Matthew.van.Eerde" for DMARC)
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Mon, 15 Jun 2020 16:33:29 +0000

You would use MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID to record 
from a particular microphone via Media Foundation. You would get the value from 
the legacy IMMDeviceEnumerator API.

It is usually easier to use the Windows.Media.Capture API than messing with 
Media Foundation directly. You would set the 
MediaCaptureInitializationSettings.AudioDeviceId for this. You would get the 
value from the Windows.Devices.Enumeration API using a selector from the 
Windows.Media.Devices.MediaDevice namespace.

From: Oleg Vorobiov<mailto:isnullxbh@xxxxxxxxx>
Sent: Monday, June 15, 2020 12:23 AM
To: wdmaudiodev@xxxxxxxxxxxxx<mailto:wdmaudiodev@xxxxxxxxxxxxx>
Subject: [EXTERNAL] [wdmaudiodev] Virtual Audio Driver: Interacting with 
user-space application

Hello!

I need help in the implementation of the virtual audio driver with the goal of 
providing a virtual microphone which receives data from the user-space 
application.
I started from Microsoft Virtual Audio Device Driver Sample (MSVAD), project - 
'micarray', with the following modifications:
1. Added handler for IRP_MJ_OPEN for the driver object
2. Added handler for IRP_MJ_WRITE for the driver object

Next, I was tried to get a symlink to the virtual device using Microsoft Media 
Foundation like described in this article - 
https://docs.microsoft.com/en-us/windows/win32/medfound/audio-video-capture-in-media-foundation<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fmedfound%2Faudio-video-capture-in-media-foundation&data=02%7C01%7CMatthew.van.Eerde%40microsoft.com%7C0b436162319747418e7408d810fcd205%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637278025872121491&sdata=rinX%2ByWYO%2B%2F%2B6pkkReYmrMZSbdtIOwAluxaETunZl8U%3D&reserved=0>
 (I changed MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID to 
MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_GUID), but I got an empty string.

Can you explain, please, how to correctly interact with the driver (based on 
micarray) from a user-space application?

Thanks!

Other related posts:

  • » [wdmaudiodev] Re: [EXTERNAL] Virtual Audio Driver: Interacting with user-space application - Matthew van Eerde