4

background:
I want to broadcast the Windows system audio except my own app's one. application loopbackcapture exactly does what I want, but it only supports Windows 11 (I want a much more general solution, Windows 7/8/10/11).

current solution:

  1. create a virtual audio output device, and set it as system default.
  2. capture audio from the virtual audio output device, and broadcast it.
  3. route audio from the virtual audio output device to the system physical one.

I tried VAC (Virtual Audio Cable), things work fine. However it does not provide any APIs to create virtual audio device and route audio streams between audio devices.
So my question is how to create virtual audio devices and route audio streams between them.
Thanks.

platform:
Windows 10
WASAPI
visual studio 2019

information I googled:

  1. How to create a virtual audio input device to simulate a microphone in MacOS
  2. https://vb-audio.com/Cable/
  3. https://github.com/HSpear/virtual-audio-wire
  4. https://jackaudio.org/faq/jack_on_windows.html
TianpingHsu
  • 91
  • 2
  • 5
  • Audio devices, both physical and virtual, are represented by device drivers. This is the case for your example (3) and most likely also for VAC. In other words, you'll have to write your own WDM driver. Here's a Microsoft example that looks like an updated version of your (3): https://learn.microsoft.com/en-us/windows-hardware/drivers/audio/sample-audio-drivers. I don't think that'll gain you anything over VAC though since drivers have to be installed by the end user. There's just no win32 API to create audio devices on the fly. – Sjoerd van Kreel Jan 02 '23 at 10:01
  • thank you very much. I build the [AudioMirror virtual device](https://github.com/JannesP/AudioMirror) and install it on my Windows, then I just know that drivers have to be installed by the end user (with admin privilege). Maybe I should use [VB-Cable](https://vb-audio.com/Cable/) instead. do you have any idea of routing audio stream between virtual/physical audio devices? – TianpingHsu Jan 05 '23 at 03:44
  • WASAPI loopback works pretty well starting from windows 7, i think. Although, I wouldn't know how to exclude your own app's sound from the system mixdown. What might work: have every other app write to your virtual output device #1, have your own app write to your virtual output device #2, have your app route the loopback capture from #1 combined with #2 to a physical output device. – Sjoerd van Kreel Jan 13 '23 at 15:13

0 Answers0