终端一体化运控平台
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.
 
 
 

82 lines
2.5 KiB

  1. //using BPASmartClient.Message;
  2. //using System;
  3. //using System.Collections.Concurrent;
  4. //using System.Collections.Generic;
  5. //using System.Linq;
  6. //using System.Runtime.InteropServices;
  7. //using System.Text;
  8. //using System.Threading;
  9. //using System.Threading.Tasks;
  10. //namespace BPASmartClient.MorkS
  11. //{
  12. // public class VoiceAPI
  13. // {
  14. // public VoiceAPI()
  15. // {
  16. // BPA.Helper.ThreadManage.GetInstance().StartLong(new Action(() =>
  17. // {
  18. // while (msg.Count > 0)
  19. // {
  20. // if (msg.TryDequeue(out string str))
  21. // {
  22. // WaitMeaLSpeak(str);
  23. // }
  24. // }
  25. // Thread.Sleep(1000);
  26. // }), "语音播报", true);
  27. // }
  28. // [DllImport("winmm.dll")]
  29. // public static extern bool PlaySound(string pszSound, int hmod, int fdwSound);
  30. // private static ConcurrentQueue<string> msg { get; set; } = new ConcurrentQueue<string>();
  31. // public static void Speak(string s) => msg.Enqueue(s);
  32. // // 系统播放wav格式的文件
  33. // private static void m_SystemPlayWav(string strPlayFile)
  34. // {
  35. // try
  36. // {
  37. // if (strPlayFile.Trim() == "")
  38. // { return; }//为空不放
  39. // string strPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
  40. // strPath = strPath + strPlayFile;
  41. // int SND_FILENAME = 0x00020000;
  42. // int SND_ASYNC = 0x0001;
  43. // PlaySound(strPath, 0, SND_ASYNC | SND_FILENAME);//播放音乐
  44. // }
  45. // catch (Exception ex)
  46. // {
  47. // MessageLog.GetInstance.ShowEx(ex.Message);
  48. // }
  49. // }
  50. // private void WaitMeaLSpeak(string meal, int count = 1, int IntervalTime = 1000)
  51. // {
  52. // m_SystemPlayWav(@"Vioce\电子提示音.wav");
  53. // Thread.Sleep(1000);
  54. // for (int m = 0; m < count; m++)
  55. // {
  56. // m_SystemPlayWav(@"Vioce\请.wav");
  57. // Thread.Sleep(500);
  58. // for (int i = 0; i < meal.Length; i++)
  59. // {
  60. // string name = meal.Substring(i, 1);
  61. // m_SystemPlayWav($"Vioce\\{name}.wav");
  62. // Thread.Sleep(500);
  63. // }
  64. // m_SystemPlayWav(@"Vioce\号用户取餐.wav");
  65. // Thread.Sleep(1500 + IntervalTime);
  66. // }
  67. // }
  68. // }
  69. //}