📜  c# 控制台播放声音 - C# 代码示例

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

代码示例2
// Soundplayer only works on the Windows OS, so check if system is windows:
if (OperatingSystem.IsWindows())
{
    SoundPlayer player = new SoundPlayer("song.wav");
    player.Load();
    player.PlayLooping();
}