音频捕获未按预期工作
在我的 Microsoft Surface 应用程序中,我想使用语音捕获。所以我按照这里提到的教程(http://opensebj.blogspot.com/2009/04/naudio-tutorial-5-recording-audio.html)并修改了NAudio.dll以能够执行以下代码:
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 字节的文件,该文件是空的。我做错了什么?
In my Microsoft Surface application I'd like to use voice capture. So I followed the tutorial metioned here (http://opensebj.blogspot.com/2009/04/naudio-tutorial-5-recording-audio.html) and modified the NAudio.dll to be able to execute the following code:
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();
}
}
But this doesn't really capture the sound. I just create a file of 58 bytes, that is empty. What Am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题在这里解决:
http://naudio.codeplex.com/Thread/View。 aspx?ThreadId=239825
Problem is sovled here:
http://naudio.codeplex.com/Thread/View.aspx?ThreadId=239825