Play sound on a recording device in C# - c#

In our solution we need to play sound on one of the recording devices.
For this purpose we are using VAC (Virtual Audio Cable), but we have a problem that it creates noise in the output.
Is it possible to play audio to recording device in C#?
Is there some existing library for that or virtual audio driver is required?

There are useful 3rd-party-tools & APIs in a question was asked earlier:C# Audio Library.
I hope you find what you want.

We used NAudio library to play sound on a specific playback device.
By default VAC is duplicating audio from playback device to recording device, so by playing it on virtual device it's also played on recording device.

Related

CSCore with audio through a GoXLR

I'm building an audio visualizer app in Unity and I'm currently using WASAPI to get the audio from any app playing audio.
I recently had someone with a GoXLR test it and the visualizer wasn't picking up the audio. I think all the audio is going directly to the GoXLR bypassing WASAPI. I can't debug it myself as I don't have a GoXLR so I wanted to know how I could pick up the audio from the GoXLR.

Naudio- Multiple sound device playback and recording issue

i am using WaveOut and WaveInEvent to record sound from multiple usb sound devices and playing it back to them. i am talking about 4-6 external usb sound cards that i have to record and playback at the same time all together.
so it means that for every sound device i have one object of WaveOut with the soundDevice ID and one object of WaveInEvent with the same SoundDevice ID (for record&playback).
my c# project throws mmexeption with explanation :"unspecified problem" when i am calling to the WaveInEvent.startRecording(). sometime it happens in the init of the WaveOut with the stream.
i thought that maybe there is a limitation of opening sound card devices for play&record or maybe naudio cant support it.
so is the limitation exist? or maybe i have to use diffrent object then WaveOut and WaveInEvent when handling multiple sound card device?
tried to play on all devices from Winamp and when I got to the forth sound card it didn't play.
I tried to plug one sound card to a different USB hub of the pc (not different port at the same hub, a new port on a different hub) and suddenly it works! also with Naudio. now i can open all of them to playback and record. I haven't tried massive check yet but its looking good.
it's seems like that the problem was that I overloaded the usb hub. I don't know if it because the usb hub doesn't has enough bandwidth or because something that belongs to voltage issue.

playback audio to a non-default playback device in .net

How can I playback audio to a non-default playback device in .net? Help would be wonderful! Audio playback to the default playback device is easy, however machines can have multiple playback devices for many reasons, and many common application allow selecting a non-default device for playback and recording. Is there a way to do this hopefully avoiding pinvoke? media foundation or core audio? Thank you in advance.
KindReality,
This might be useful to you. NAudio has seemingly already wrapped up a few API's for you (and, I imagine, handles those low level calls so you don't have to). Scrolling down to "NAudio Features" will most likely reveal whether or not this is what you're looking for.

how to find the main speakers directshow audio device

I am capturing the desktop using VLC and DirectShow an I need to find the main speakers audio device in order to capture all the sound from the desktop, can this be done programmaticly ?
I am using C# in windows XP and 7
You actually cannot capture data from speakers. The real options are:
audio capture from real audio input device, such as microphone
audio capture from loop back device (provided that it is enabled)
Note that loopback capture is different in Vista+ and older systems, also previously discussed here:
Is it possible to record sound played on the sound card?
Get sample of sound from stereo mix in Windows
https://stackoverflow.com/questions/6993186/windows-7-any-audio-libraries-supporting-loopback-audio-capturing-in-c

Measure speaker volume by recording playing sound with microphone

I want to measure a system's speaker volume by playing a sound and listening for it on a local microphone at the same time. This is for a specific application. The exact recorded sound is not as important as differentiating between the microphone volume recorded before the sound is played and while it is playing.
The idea is to warn the user if speakers are turned off or too low. How can I record a sound while playing it and determine a difference in volume? Are there are any managed libraries to do this?
Update: Found a good related question.
Take this:
http://windowsmedianet.sourceforge.net/
and use waveIn managed wrapper.
http://msdn.microsoft.com/en-us/library/ms712636(VS.85).aspx
Of course, you'll need some calibration there...

Categories