MMDeviceEnumerator deviceEnum = new MMDeviceEnumerator(); MMDevice wspidevice = DeviceEnum.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.Active) [deviceNumber]; waveIn = new WasapiCapture(wspidevice); waveIn.DataAvailable += OnDataAvailable; waveWriter = new WaveFileWriter(fileName, waveIn.WaveFormat);privatevoid OnDataAvailable(object sender, WaveInEventArgs e) {if (waveWriter == null) return; waveWriter.Write(e.Buffer, 0, e.BytesRecorded); waveWriter.Flush(); }
I think that routing will be done in OnDataAvailable event, by checking sender object? Am I true, or is there an another way to do that?