在我的Microsoft Surface应用程序中,我想使用语音捕获。所以我按照这里提到的教程(http://opensebj.blogspot.com/2009/04/naudio-tutorial-5-recording-audio.html)修改了NAudio.dll,以便能够执行以下代码: / p>
class AudioRecording
{
private WaveMixerStream32 mixer;
public AudioRecording()
{
mixer = new WaveMixerStream32();
mixer.AutoStop = false;
}
public void start()
{
Console.WriteLine("Start recording");
mixer.StreamMixToDisk("Test.wav");
mixer.StartStreamingToDisk();
}
public void stop()
{
Console.WriteLine("Stop recording");
mixer.StopStreamingToDisk();
}
}
但这并没有真正捕获声音。我只是创建一个58字节的文件,它是空的。我做错了什么?