Audio libraries for digital signal processing in C#
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 per开发者_如何转开发forms 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
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
It's never easy to predict if Microsoft is going to abandon the products they currently push. As for XAudio 2 vs DirectSound, I'd definitely go with XAudio 2. Not only because it is intended to replace DS, but also because the API seems more flexible.
However, you may take a look at how NAudio do their playback.
did you look at Windows Media Format 9.5 SDK. http://msdn.microsoft.com/en-us/windows/bb190309.aspx
Links: http://www.codeproject.com/KB/audio-video/ManWMF.aspx
精彩评论