推荐的方式与音频的.NET应用程序的工作? [英] Recommended way to work with audio in .NET applications?

查看:276
本文介绍了推荐的方式与音频的.NET应用程序的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始使用.NET 3.5下一个简单的音频应用程序(preferably在VB.NET,但会愉快地使用C#)。我想要做的是:

I'm trying to get started with a simple audio application under .NET 3.5 (preferably in VB.NET, but will happily use C#). What I'd like to do is:

  • 从(默认值)连续记录音频的Windows的音频输入设备中的8位 - 每样PCM格式
  • 在每N个字节抓获,做原始音频部分的分析(一些RMS和/或SPL计算 - 基本上你需要为pretty的VU柱状图啄什么的)
  • 如果音频片段分析发现后有意思,使用COM pressed文件格式保存(如MP3)

我首先注意到的是,在基本的.NET框架的音频支持是pretty的多少不存在的。谷歌搜索了一下周围发现了一些样品code,大多采用托管DirectX。然而,由于缺乏MSDN文档,图书馆(2004年)和下面的来势汹汹MDA例外,在2008年VS.NET的葡萄酒,使我确信这是一个死胡同:

First thing I noticed is that audio support in the basic .NET Framework is pretty much nonexistent. Googling around a bit found some sample code, mostly using Managed DirectX. However, the lack of MSDN documentation, vintage of the libraries (2004) and the following menacing MDA exception in VS.NET 2008, convinced me this is a dead end:

Message: DLL 'Microsoft.DirectX.dll' is attempting managed execution inside 
OS Loader lock. Do not attempt to run managed code inside a DllMain or image
initialization function since doing so can cause the application to hang.

......我认为松散翻译为甚至不尝试的使用这些东西。我失去了一些东西在这里,或托管DirectX真的死了吗? <一href="http://stackoverflow.com/questions/1502390/does-xna-effectively-replace-managed-directx">Another StackOverlow问题表明,XNA是一个替代托管DirectX,但它缺乏那种低​​层次的功能,我需要的。

...which I think loosely translates as "don't even try to use this stuff." Am I missing something here, or is Managed DirectX really dead? Another StackOverlow question suggests that XNA is a replacement for Managed DirectX, but it lacks the kind of low-level functionality I need.

那么,它的API或第三方库是在.NET开发的音频实际上有用吗?使用COM互操作或P / Invoke的是可以接受的,只要有一些不错的.NET例如code可开始使用...

So, which API or third-party library is actually useful for audio development under .NET? Using COM interop or P/Invoke is acceptable, as long as there's some decent .NET example code available to get started with...

推荐答案

你有没有看着 n音讯上codePLEX ?它看起来像它有你需要的功能。

Have you looked into NAudio on CodePlex? It looks like it has the features you need.

这篇关于推荐的方式与音频的.NET应用程序的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆