In Visual Studio
Go to solution explorer create new folder and name it sounds
Right Click on sounds folder then select Add Existing Item
Add your .wav files in sounds folder
Now go In Design View
Create New Button
Double click on that Button
Add A Namespace
using System.Media;
protected void Button1_Click(object sender, EventArgs e)
{
SoundPlayer sd = new SoundPlayer();
sd.SoundLocation = Server.MapPath("~/sounds/filename.wav");
sd.Play();
}
Done.
Download Source Code
Thanks that did the trick !
ReplyDelete