我需要捕获多个线路输入的音频。据我了解,它应该使用 WaveMixerStream32 类来完成,但无法弄清楚如何将多个 WaveIn 初始化为 WaveStream 以将它们传递给 WaveMixerStream 的 AddInputStream 方法。我可以用代码录制单行的音频:
waveIn = new NAudio.Wave.WaveIn();
waveIn.WaveFormat = new NAudio.Wave.WaveFormat(44100, 1);
waveIn.DataAvailable += new EventHandler<NAudio.Wave.WaveInEventArgs>(audioDataAvailable);
waveWriter = new NAudio.Wave.WaveFileWriter(wavFileName, waveIn.WaveFormat);
waveIn.StartRecording();