启动音频源时的SharpDX.SharpDXException-C#

时间:2019-06-05 03:57:29

标签: c# audio sharpdx accord.net directsound

当我尝试使用Accord.net录制音频时,会引发异常

  

Accord.Audio.DirectSound.pdb未加载   $ exception {“ HRESULT:[0x88780064],模块:[Unknown],ApiCode:[Unknown / Unknown],消息:Unknown”} SharpDX.SharpDXException

我在Visual Studio 2017中使用64位Windows 10 Pro。

Accord.Audio-v3.8.0

Accord.Audio.DirectSound-v3.8.0

SharpDX -v2.6.3

SharpDX.DirectSound-v2.6.3

我的代码在这里

using Accord.DirectSound;
using Accord.Audio;
namespace TestAudio
{
public partial class Form1 : Form
{
private Signal s;
public Form1()
{
    InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{  
    AudioCaptureDevice source = new AudioCaptureDevice();
    source.DesiredFrameSize = 4096;
    source.SampleRate = 22050;
    source.NewFrame += source_NewFrame;
    source.Start();
}
private void source_NewFrame(object sender, Accord.Audio.NewFrameEventArgs eventArgs)
{
    s = eventArgs.Signal;
}
}
}

0 个答案:

没有答案