i found a way of doing it but i keep getting a error for this code
private void label1_Click(object sender, EventArgs e)
{
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation =
@"C:/Users/Ussssssssssser/Desktop/sounds/elvis.wav";
player.Play();
}
it highlights player.Play(); and says
InvalidOperationException was unhandled
Sound API only supports playing PCM wave files.
and i dont know how to fix it, im really new at C#
The exception message is pretty much all you need to know. Where did you get your wave file? Perhaps try another... maybe record one of your own with sound recorder to test it out. If the one you made yourself works, that's a pretty good indication that the other file is no good. If it doesn't work, something else might be going wrong.
Hmm, I did some googling around (again, you should really do this...) and it sounds like there might be a problem with streaming sound content over the web. Are you trying to do this, or is this a local application? I'm at home right now and recently got a new computer so I don't have VS installed. I'll try making a test project tomorrow when I'm at work, but I'd still recommend you try the above suggestions (a wave file you created, and googling around for more information).
I'll try to get back to you tomorrow.