tags:

views:

513

answers:

2

I'm trying to write a SAMPLER program, where each key has a different sound (a WAV file).

Can someone explain to me or give me a link to an explanation where i can learn how to play the WAV files?

If it matters, I'm working with Microsoft Visual C# and using WinForms.

+5  A: 
SoundPlayer simpleSound = new SoundPlayer(strAudioFilePath);
simpleSound.Play();
ArsenMkrt
can pause and resume features be made for it?
Rahul2047
I don't know to be a honest, but take a look to this low level player... http://www.codeproject.com/KB/audio-video/cswavplay.aspx, and if you are using .net 3.5, you can use MediaElement which supports pause and resume.
ArsenMkrt
+1  A: 

use fmod, which is simply the best sound library in the whole universe

fortunately, they seem to provide a C# wrapper for the best audio API you could try to imagine, and you won't have to change a single line of code to make your code working on playstation or xbox or whatever the developers are pretty much reactive (you report a bug in the evening, go to bed, and the corrected build is available as you wake up) documentation is readable, understandable, and HUGE lot of examples in the SDK, which makes it useless to provide a tutorial since documentation is pretty much perfect

playing a wav with FMOD is just 5 lines of code, and with just 4 lines more you can apply effects while linking the balance and volume of the playback to a 3d engine (to handle intersections between the consc point and the audio source, 4 lines....

if you want to (use C# to) do sound, -> FMOD.