I have made the simplest test in order to check if SoundPlayer will play a wave file.
From the local machine works just fine, once the site is on IIS it doesn't play the sounds (or give any error).
Here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Media;
public partial class Default2 : System.Web.UI.Page
{ public SoundPlayer spWave;
protected void Page_Load(object sender, EventArgs e)
{
spWave = new SoundPlayer("\\server\site\wavetest.wav");
spWave.Play();
}
}
Is there anything else I need to add to the .aspx file to get this to work?
Or is there an easier way of playing very short wave files, without displaying any media controls on the page?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…