📜  如何在 c# windows 窗体上一次播放多个声音 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:05.650000             🧑  作者: Mango

代码示例1
var p1 = new System.Windows.Media.MediaPlayer();
p1.Open(new System.Uri(@"C:\windows\media\tada.wav"));
p1.Play();

// this sleep is here just so you can distinguish the two sounds playing simultaneously
System.Threading.Thread.Sleep(500);

var p2 = new System.Windows.Media.MediaPlayer();
p2.Open(new System.Uri(@"C:\windows\media\tada.wav"));
p2.Play();