Need multiple sound outputs to multiple speakers - c#

How do I play 3 different music tracks at the same time on my computer, such that song1 is played in speaker1, song2 in speaker2...
Is this possible programatically? What additional hardware will I need? Do I need 3 seperate sound cards? Given that the hardware is in place, how would I "route" the sound output for a particular song to a particular speaker.
Alternatively, is there a special hardware that can handle multiple inputs and outputs?
Appreciate your expert opinions.

http://www.esi-audio.com/products/maya44usb+/ Try this with the NAudio c# Libary look at AsioOut and the MultiplexingWaveProvider

Provided that you have as many outputs (total) as you have songs you are all set (I'm assuming you'll just be playing each song in mono). The simplest way to tackle this problem is to open one "stream" for each song and play the song through that stream. You'll have to do some work to open each stream with the right number of channels and ensure that the song is played in the correct channel.
There are two potential problems with that technique: 1. some audio API/hardware combinations don't allow multiple streams to access the same device. This is most commonly an issue on windows/ASIO, but it may be an issue in other cases -- I am not a windows expert. 2. it is a bit tricky to ensure that all streams are exactly synchronized. If you require tight synchronization you should use a single stream and a single hardware device.
If the above issues are a concern, then you should get some audio hardware with at lest three outputs, and open one stream with access to three channels.
You can use PortAudio for audio I/O, and libsoundfile for reading the sound files (of course, there are other options for both these tasks).

Related

Asio, c#, recording sound from microphone and line inputs simultanously

i'm trying to capture sound from several interfaces of single audio card. Can i get arrays that not shifted relative to each other ? I want to use 4 microphones (2 microphone in one interface for each channels) to detect sound emitter position.I use windows, so i can't create aggregated device. I also recorded sound from different threads, but delay between arrays was very randomly. This is main problem, because i want to apply intercorrelation function for array to get delay(shift) that gives maximum value, this shift defines angle to sound source, so i can use anything different against of ASIO, but it's must be stable for all recording interval. If there isn't solution for c#, i know c++. Please, tell me how i can solve my problem.
If all mics are connected to the same hardware device you can use ASIO, assuming the device actually has ASIO drivers. If not, you can either try ASIO4All (but i have no idea whether it will synchronize independent devices) or use WASAPI and perform synchronization manually. WASAPI's IAudioCaptureClient::GetBuffer method will give you both the stream position and stream time at which the position was recorded, from there you should be able to work out the time shift between each of the 4 mics and then perform "unshifting" yourself.

C# mixing the same inputs by 3 independent mixers

Good evening,
I'm facing a problem which might be easy in the end.
I've got different audio sources on a single pc: Two Teamspeak instances, one VOIP connection, sound samples and background noise. Now there are three independent Headphone devices. Each one needs to mix all the source streams.
How would you achieve this? I thought of creating virtual audio devices, sending all source's streams to them, split each stream 3 times, mix them and send them to the headphones in the end. Is that possible?

How to intercept and record or modify signals between hardware and software

My understanding of how this stuff works is very limited, as I usually just make library calls which make the audio / video magically show up.
I want to be able to do MITM "attacks" to programs on my own computer. (I'd be the guy intercepting signals between the software and the hardware). This kind of thing could be useful in a number or scenarios.
For instance, for audio:
XP doesn't have a way to change the audio for specific programs while keeping the others unchange. It only has one audio
manager across all its programs. If I could intercept the signal (and
detect which program it was coming from) I could in theory make my own audio manager.
I could record conversations, possibly testing out any audio -> text software I may have/create.
many more.
For video:
(Primary goal here): record conversations. I have used a third party program, but I'm guessing what it is doing is taking snapshots because 1) the video is choppy and 2) when the mouse or other thing gets in the way of the video, it records that too. Wouldn't it be easier just to record the signal going to the video card from the specific program of my interest, then play it back when I want to see it again?
For network traffic:
For recording traffic to and from my computer, possibly discovering
programs that are communicating that shouldn't be.
For keyboard/mouse:
This could be useful for easily creating macros to fill out forms or
whatever, and I could custom encrypt the data to make sure it's
secure rather than relying on some third party software.
I'm sure there are many other applications for which this could be useful.
Thanks.

Need to record all sounds from sound card with NAudio in Windows 7

Need to record all sounds from sound card. So that mic+output was written to file.
Is it possible to do with NAudio library in Windows 7? Cant find any examples, found just ones that allow to write mic or just sound from speakers, not both.
PS, sorry, if the question looks not ok..Im new to audiorecording.
Added issue ive asked on codeplex: http://naudio.codeplex.com/workitem/16353
To record sounds being played by the soundcard, you would use WASAPI in Loopback Mode.
To record sounds going into the microphone you could use WASAPI capture, or any of the other microphone capture classes in NAudio.
Then you have the slightly tricky job of mixing those two inputs together. This may require sample rate conversion beforehand, and it may require you to timestamp the recorded audio (as the loopback audio can contain gaps when nothing is being played).
With NAudio, you would convert both streams to floating point, before mixing them using one of the "Mixer" wave or sample providers in NAudio, and then writing that back out to a file.
So yes it is possible, and I have done it once before myself, but it does require you to write a fair bit of your own code on top of the core NAudio libraries.

Audio capturing in C#

I have a MAYA 44 USB sound card and would like to interface it with C#. I want to record from the provided microphones and produce a data array.
I have found examples when using the internal sound card from my laptop but when it comes to external it does not quite work.
Has anyone every connected the above sound card with C# please?
Have you had a look at the DirectSound API (Windows only though, I think). Might provide what you're after.
On how to record audio with C# in general there are already multiple threads on SO, so I won't talk about that.
I see two possible causes for your program which have different solutions:
You need to change which audio sources are muted in the windows volume control ("sndvol32.exe /R")
When opening the audio device there are multiple devices. And you're simply opening device 0 instead of enumerating them and perhaps choosing another one. The external sound-card might appear as a second device.

Categories

Resources