I must mix multiple wavein sources from different wavein devices for switching the output of mixer to another waveOut device.
Also, I must mix udp source wave streams with wavein streams, too.
First of all, I have decided to code the analog part like this below.
public void LoadWaveInToMixer(int deviceNumberIN)
WaveIn ss = new WaveIn();
ss.DeviceNumber = deviceNumberIN; //always different device numbers
ss.WaveFormat = new WaveFormat(8000, 16, 2);
WaveInProvider wp = new WaveInProvider(ss);
WaveProviderToWaveStream ws = new WaveProviderToWaveStream(wp);
WaveChannel32 wc = new WaveChannel32(ws);
mixer.AddInputStream(wc); //WaveMixerStream32 object
if (mixer.InputCount == 1)
My problem is if I add second waveIn device to the mixer(call this functon twice), I am getting and MMEXception (already allocated)
I have set deviceNumberIN to different device numbers every time I call this function. I have collected devices present in the system at the beginning of the program.