don't hear any sound,when publishing ASP.NET web application
I have a website application in ASP.NET. I have two mp3 sounds. Everything
works in the computer(in localhost). When I publish the website, I have no
error but when press the button, there is no sound. I don't hear anything.
What am I doing wrong? Thanks
protected void Button1_Click(object sender, EventArgs e)
{
var firstVoice = new System.Windows.Media.MediaPlayer();
var secondVoice = new System.Windows.Media.MediaPlayer();
firstVoice.Open(new System.Uri(Server.MapPath("~/") + @"\first.mp3"));
firstVoice.Play();
System.Threading.Thread.Sleep(1500);
secondVoice.Open(new System.Uri(Server.MapPath("~/") + @"\second.mp3"));
secondVoice.Play();
secondVoice.Stop();
}
In this code I have two sounds playing simultaneously.
No comments:
Post a Comment