8
votes

Hey everyone. Is there a way of outputting audio from my program and redirecting that stream to the system's microphone input 'layer'? I understand this might require some low-level calls being 'Pinvoked', but are there any articles that might help me. For example, if I was to run the output audio stream of my application into Window's Sound Recorder program, it would think that the audio is coming from a microphone and thus record that. I don't want to record a stream, just output it to the device's micrphone input. Thanks for any ideas.

6
You can use the recording volume control to un-mute WaveMix on most soundcards. But this is a global state and not per program.CodesInChaos
Would it not make more sense to have your application register itself as an additional microphone within Windows? That way you aren't hijacking the functionality of any hardware and your user is free to select your application as their (virtual) input device. I don't have any personal experience with this, but it seems a more logical approach.Nathan Taylor
why not just use the mixer as input? is it a requirement that it have to be the microphone?jcomeau_ictx
Sorry, I'm new to managing audio. I assumed I had to replace the microphone because any other program on the user's system might use it. For example, if the user was using Live messenger and talked via the microphone, I'd like to be able to have my program output the audio and feed it into the Live messenger's microphone. I don't mind registering as an additional microphone (I didn't know that was possible without hardware)Brap
@Brap there's a reasonable possibility that creating a 'virtual microphone' is going to fall significantly outside of the scope of .NET. I spent the last ten minutes Googling for examples and all I've come up with so far is this: software.muzychenko.net/eng/vac.htm.Nathan Taylor

6 Answers

2
votes

I used VB-CABLE (which works as an audio device driver, not external software) to do exactly what you want.

https://www.vb-audio.com/Cable/index.htm

One single input/output device for free and 2 additional devices can be added with a donation.

1
votes
0
votes

Consider looking into Pure Data (PC) or Max MSP (Mac) for this type of issue.

0
votes

It sounds like you are looking for a virtual audio driver. You can purchase software from Softonic that already does this. If you need to build it yourself, then you can manage this using DirectSound (part of the DirectX library) from Microsoft.

0
votes

if you're ok recording with VLC and are on vista+ then this https://github.com/rdp/virtual-audio-capture-grabber-device could help

0
votes

If your application can access VST's, then you can use wormhole2, which is open source and works for Mac and PC. It can send and receive Audio in a VST compatible host. http://code.google.com/p/wormhole2/

If not, at least on mac, there is Soundflower from cycling74 which installs a framework for audio ins and outs which are available in the whole system. cycling74.com/soundflower-landing-page/

As an equivalent on PC, there is: http://jackaudio.org/ which basically does the same as Soundflower.