briankendall / proxy-audio-device

A virtual audio driver for macOS to sends all audio to another output
The Unlicense
514 stars 33 forks source link

Proxy microphone #16

Closed yyl-20020115 closed 1 year ago

yyl-20020115 commented 2 years ago

Hi Brian, How can I modify the code to proxy built-in microphone ? I mean capture microphone data and the other application can read the data from the device of this driver.

Best Regards, Yilin

briankendall commented 2 years ago

That would be a significant modification, and it's not something I can easily describe quickly. You'd have to change the code of the function outputDeviceIOProc that runs in a separate thread so that it's reading data in from an input device, storing it in a ring buffer, then writing that same data out to the proxied input device. So basically what the device is currently doing, but in reverse. You'd also have to change the metadata about the device so that it reports itself as having two inputs rather than just two outputs.

Is there any reason you can't just read data directly from the built-in microphone? It ought to be possible for more than one app to read its input.

chenyangxx commented 1 year ago

He may want to record system sound

briankendall commented 1 year ago

What Yilin was describing was proxying an input device, not making a loopback device like Soundflower, BlackHole or Loopback. I'd recommend any of those if that's what you're looking to do. The proxy audio device is just about... [dramatic pause; drumroll] ...proxying an existing audio device.