当我在Microsoft Visual Studio中运行时,声音会正常工作。然而,在我发表它之后,声音就不起作用了。声音属性设置为"内容"。有人能帮忙吗?感谢
private void InitializeSound()
{
// Create an instance of the SoundPlayer class.
player = new SoundPlayer(@"Soundssirenpolice3.wav");
}
在此处输入图像描述
尝试此示例
using (var player = new SoundPlayer(@"Soundssirenpolice3.wav"))
{
// Use PlaySync to load and then play the sound.
// ... The program will pause until the sound is complete.
player.PlaySync();
}