string sound = Application.StartupPath [email protected]"\song\123.wav"; //Application.StartupPath:程序exe所在的位置,也可以直接写一个音乐的路径
SoundPlayer player = new SoundPlayer(sound);
player.Load(); //把声音加载到内存
player.PlayLooping();//播放
player.Play();
仅限.wav格式
c#播放mp3文件
http://www.cnblogs.com/igrl/archive/2010/03/29/1699975.html
时间: 2024-10-18 12:57:29