Is there a way to play audio fragments in C # without installing the DirectX SDK?

For a school project, I need to create a program, and it would be nice if it included some sound effects. We use C # (and Visual C # Express Edition 2008 Edition) to encode our programs, and I was wondering if in any case playing short audio files without installing the DirectX SDK.

On our school computers, we do not have sufficient access to install any SDKs, and we must use these computers for development. Is there a way to play audio files without a DirectX SDK?

+4
source share
2 answers

You can use System.Media.SoundPlayer , but it will only work with wavs.

+5
source

You can also add sound effects with a speech engine (.net3)!
Fun, fun, fun!

Add link to dll System.Speech

using System.Speech; System.Speech.Synthesis.SpeechSynthesizer ss = new System.Speech.Synthesis.SpeechSynthesizer(); ss.Rate = 8; ss.SpeakAsync("Booom Booom Booom Booom Booom Booom"); 

Try increasing / decreasing speed and pitch for more fun.

+3
source

All Articles