Audio libraries for digital signal processing in C#

user226024 picture user226024 · Dec 7, 2009 · Viewed 7.5k times · Source

My problem is this:

I'm developing a reasonably small application (which needs to be able to grow in the future, but for now, limited functionality will suffice) which recieves audio (16bit mono @ 44.1kHz) and performs fourier transforms and filtering on the data. My experience with all the fields you can imagine this involves is limited, but i've been researching it a fair bit lately and have some understanding. My funding is limited, and I am unable to use any libraries which are under the GPL or similar licences (I need to be able to distruibute this app). For the signal processing I've settled on MathNet libraries, and this seems as though it can handle the bulk of the processing (and I'll write the necessary filters).

The real problem is finding the sound library to use - I was hoping for something in C#, and while it seemed directSound was the best option, I'm reluctant to use it given microsoft has pretty much abandoned it (the company I work for will be upgrading its gear in the near future; I just want to increase the app.'s lifespan as best I can). Do I use XAudio2? I need to be able to record the raw pcm data from a USB device and process it (+write it out to .wav files), and read the data straight from .wav files.

Any help is appreciated

Answer

user542614 picture user542614 · Dec 14, 2010

First, I want to say that DirectSound isn't abandoned by Microsoft, it's still a supported technology (Windows 7) and I don't expect it to stop working in the future.

That said, there are newer audio APIs / SDKs that are more modern: Media Foundation can perform audio capture and there are a number of great samples to jumpstart you. IF you are looking for the latest and greatest or are looking for hardware accelerated audio you can try and get things working using WASAPI and WaveRT.

Just an FYI, the Media Format SDK is no longer at the URL given in the first post. Please use this one instead:

http://msdn.microsoft.com/en-us/windows/bb190307