示例代码:

var fileName = @"D:\WindowsLogon.wav";
DevicesCollection sound_devices = new DevicesCollection();
Device sound_device_output = new Device(sound_devices[0].DriverGuid);
sound_device_output.SetCooperativeLevel(new WindowInteropHelper(this).Handle, CooperativeLevel.Normal);     //设置设备协作级别
SecondaryBuffer secondary_buffer = new SecondaryBuffer(fileName, sound_device_output);                      //创建辅助缓冲区
secondary_buffer.Play(0, BufferPlayFlags.Looping);                                                          //设置缓冲区为循环播放

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
相关资源
相似解决方案