简体   繁体   English

Visual Basic-声音检测

[英]Visual basic - Sound detection

I am trying to make a program in Visual Basic .NET that is going to detect sound from the microphone input on my pc. 我正在尝试在Visual Basic .NET中制作一个程序,该程序将从我的PC上的麦克风输入中检测声音。 The program is going to receive a series of beep sounds (sound/nosound) that is going to be translated in to binary data to create a file. 该程序将接收一系列蜂鸣声(声音/声音),这些声音将转换为二进制数据以创建文件。

I have tried multiple codes to detect sound from the microphone and tried multiple codes to detect frequency and activity. 我尝试了多种代码来检测麦克风的声音,并尝试了多种代码来检测频率和活动。 But none of them work. 但是它们都不起作用。

Is there any API/Library for .NET out there. 是否有用于.NET的任何API /库。 Any old code which I can try to remake? 我可以尝试重制任何旧代码吗? Really need this for my program. 我的程序真的需要这个。

I can't help with the frequency part, but I do have something I use to detect volume coming in. It's a C# project, but I compile it and then reference it from my VB.Net code. 我不能帮忙频率部分,但确实有一些东西可以用来检测音量。这是一个C#项目,但我对其进行了编译,然后从我的VB.Net代码中引用了它。 Basically, I wait for a spike in sound and then perform an action when it occurs: 基本上,我等待声音尖峰,然后在出现尖峰时执行操作:

http://www.codeproject.com/Articles/20503/LED-Style-Volume-Meter-Using-DirectX http://www.codeproject.com/Articles/20503/LED-Style-Volume-Meter-Using-DirectX

It requires DirectX which is a large install so it may not be desirable (but, it will help with half of your problem). 它需要DirectX,这是一个很大的安装,因此可能不是很理想(但是,它将帮助解决一半的问题)。

You can also take a look at the NAudio project on CodePlex. 您也可以在CodePlex上查看NAudio项目。 It has a lot of audio based code that a decent following. 它有很多不错的基于音频的代码。

http://naudio.codeplex.com/ http://naudio.codeplex.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM