Pergunta

I'm using a certain application, processing the audio coming in on sound-card's microphone jack. As I need it to process the audio played on my Windows 7 system, I've physically connected a cable between sound-card's speakers output-jack and microphone's input-jack.

Could this be accomplished by software, e.g. by NAudio?

I've found an answer on this thread which seems to describe how to accomplish the opposite route, i.e. microphone-to-speakers, but could not figure how to transform it to do the other way around.

I've also found this non-answered question, which seems to be close in goal, although bottom-line different.

I'm using VB.Net 2010. Target platform is Windows 7 or above.

Using an external audio-routing application such as 'Virtual Audio Cable' is currently not a valid option.

Foi útil?

Solução

To route audio output as another application's input you need to be able to take care of the following:

  1. To select specific audio output on the playing application
  2. To select specific audio input on the recording/processing application
  3. To connect input and output together

There are a few ways to achieve the mentioned items.

An obvious solution is hardware loopback. This covers #3 above and others are covered by plugging cable into proper connectors. No software needed, but there are obvious drawbacks: overhead, noise and possible quality loss due to DAC and ADC conversions, inability to use certain multi-channel formats.

Then, you can install Virtual Audio Cable which creates a pair of devices connected behind the scenes. You marked this solution as unsatisfactory, so we are skipping it.

Next option is software loopback device. This option is hardware dependent and available on many onboard audio devices. Playback happens as usually and you have an additional audio input device available that produces a copy of audio feed sent to hardware output. Once you enable this device (typically disabled by default) you need to use this device as audio input on your processing application. See Is it possible to record sound played on the sound card? for details. This is similar to hardware loopback but without a physical cable. Same drawbacks apply. Supposedly, this is the closest to your needs.

And then another option is a pair of software only pair of virtual audio devices. Similar to Virtual Audio Cable, but having specific applications consumers of these devices it is possible to implement the devices in user mode without third party app setup, without necessity of administrative permissions in particular. I am not aware of any out of the box implementations and this is unlikely to be a solution for you if you are going to stay with VB.NET only (that is, needs advanced programming anyway, even though no need for a kernel-mode driver).

Outras dicas

Unfortunately not with NAudio, because you'd need to create a fake audio input device. You really do need something like a Virtual Audio Cable to accomplish this task. That's because to make a sound device appear in windows, you'll need to write a driver to do this.

Also, you'd need to beware of creating a feedback loop with the setup you describe.

Man ,

Right click audio icon and select Recording Devices, right click and select Show Disabled Devices and StereoMix should apprear. Enable StereoMix and then select in your application (Skype, TeamSpeak or whatever) the StereoMix as Input Device and that's it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top