How to create a virtual audio input device to simulate a microphone on windows?

2k Views Asked by At

I need to create a virtual audio device programmatically on Windows so I can write sample data to it and have other applications on the system use it as a microphone. I'm using Windows 10 and looking for a solution in rust or c++.

The idea is to create an audio stream from a file and write or redirect this stream to an audio input device that other programs can use as a microphone.

I've looked into using the Windows Core Audio API, but I'm having trouble finding examples or documentation on how to create virtual audio devices programmatically. I've also looked into using the WASAPI but I'm unsure if this is the right approach.

Any help would be greatly appreciated. Thank you!

1

There are 1 best solutions below

7
On

I went through this exercise recently and it took me several weeks as an experienced developer new to kernel mode driver development. I started with this sample and needed to add a ioctl support for data transfer from user mode to kernel mode. https://github.com/microsoft/Windows-driver-samples/tree/main/audio/simpleaudiosample