I know this might sound like a subjective question, but I need some well-founded opinions on this topic:
In a C#/WPF GUI I need to playback short wave files as a response to user interaction.
The specs are as follows:
- low latency (immediate start of playback)
- code should be native C# (.Net 4.0)
- must get along with WPF
- multiple simultaneous playbacks
- no restrictions on sound buffer manipulation
- guaranteed future (I want to use something that will still have support in a few years.)
- sound player module should be a simple class (= C# code), not an encapsulated dll
Until now I got along quite well with DirectSound (using the Microsoft DirectX SDK), it fits all of the requirements mentioned above. Since Visual Studio 2010 (.Net 4.0), Managed DirectX (MDX) is not supported anymore, and it also disappeared from the latest DirectX SDK.
What are my options now?
- XNA seems overkill (too large) to me, since I'm not developing a game, but an application. See this question for some more information.
It's supposed to be the replacement of MDX, but I read a lot of scary stories about it's implementation. Or is that all fairy tales? - SlimDX might be an option, but it's a third-party product and again a fairly large project.
- There are some "smaller" solutions I know of, each with it's own drawbacks:
- MediaElement (only with WMP10+)
- P/Invoke with WinMM
- PlaySound
- SoundPlayer
- MediaPlayer
- There are tons of custom audio libraries in the wild, which work more or less well.
(NAudio, BASS, waveOut...)
I'm really puzzled about which one I should use for a new project. I don't want to dig into a whole new framework just to find out that its limitations prevent me from using it.
Thanks in advance!