C#使用HWQPlayer类播放wav文件 类的代码: using System.IO; using System.Runtime.InteropServices; namespace HoverTreeSound.HewenqiFrame { internal class HWQPlayer { [DllImport("winmm.dll")] private static extern int sndPlaySoundA(byte[] lpszSoundName, int uFla
1.引用System.Media名称空间下的类SoundPlayer SoundPlayer player = new SoundPlayer(); 2.方法调用Play(); public void Play() { player.SoundLocation = @".\x0pbk-swz4q.wav";//读取音频文件 player.Load();//同步模式 player.Play(); if (MessageBox.Show("播放音樂中,通过旋转耳机上的