终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142
  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. }