playing a sound

  • Thread starter Thread starter Gregory Khrapunovich
  • Start date Start date
G

Gregory Khrapunovich

How can I play a sound from a .wav file? Is there a way to incorporate .wav
file in the application so I won't have to redistribute it with the
executable?
Thank you.
Gregory Khrapunovich
 
Gregory Khrapunovich said:
How can I play a sound from a .wav file? Is there a way to incorporate
.wav
file in the application so I won't have to redistribute it with the
executable?

If you are using .NET 2.0, you may want to use
'System.Windows.Forms.SoundPlayer'. For older versions of the .NET
Framework you can add the wave file as embedded resource and use the code
shown on the page below for playback:

<URL:http://dotnet.mvps.org/dotnet/code/misc/#PlaySound>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top