终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

43 righe
1.1 KiB

  1. using BPASmartClient.Message;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace BPASmartClient.MorkS3
  9. {
  10. public class VoiceAPI
  11. {
  12. public VoiceAPI()
  13. {
  14. }
  15. [DllImport("winmm.dll")]
  16. public static extern bool PlaySound(string pszSound, int hmod, int fdwSound);
  17. // 系统播放wav格式的文件
  18. public static void m_SystemPlayWav(string strPlayFile)
  19. {
  20. try
  21. {
  22. if (strPlayFile.Trim() == "")
  23. { return; }//为空不放
  24. string strPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
  25. strPath = strPath + strPlayFile;
  26. int SND_FILENAME = 0x00020000;
  27. int SND_ASYNC = 0x0001;
  28. PlaySound(strPath, 0, SND_ASYNC | SND_FILENAME);//播放音乐
  29. }
  30. catch (Exception ex)
  31. {
  32. MessageLog.GetInstance.ShowEx(ex.Message);
  33. }
  34. }
  35. }
  36. }