I've found some tutorials but they all need to browse the file first. I need to play the file automatically without the need of finding it by a browse button.

Recommended Answers

All 2 Replies

System.Media.SoundPlayer sp = new System.Media.SoundPlayer();
sp.SoundLocation = @"c:\path\to.wav";
sp.Play();

If you have the path in a variable, just substitute it in the second line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.