mdb
mdb

Reputation: 52829

Recommended way to work with audio in .NET applications?

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:

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.

...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.

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...

Upvotes: 7

Views: 3102

Answers (4)

DanStory
DanStory

Reputation: 371

Another is FMOD.

Upvotes: 1

Dean J
Dean J

Reputation: 40298

I've been a fan of the BASS library which has a .NET API.

Upvotes: 2

Ron Warholic
Ron Warholic

Reputation: 10074

If you want to try a DirectX based sound solution you can use SlimDX. It supports DirectSound and XAudio interfaces.

Upvotes: 1

LBushkin
LBushkin

Reputation: 131676

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

Upvotes: 4

Related Questions