如何在WinForms中播放声音?

时间:2009-08-20 05:58:53

标签: c# winforms audio

如何使用C#在WinForms中播放声音?

2 个答案:

答案 0 :(得分:17)

简单地播放声音,没有交互,你可以使用System.Media.SoundPlayer:

System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = "soundFile.wav";
player.Play();

答案 1 :(得分:9)

Audio是这类功能的绝佳库。你可以在这里找到它: http://naudio.codeplex.com/

&安培;这里有一个介绍性的教程: http://opensebj.blogspot.com/2009/02/introduction-to-using-naudio.html

干杯, 塞巴斯蒂安

相关问题