CSpeech.h 614 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #define _ATL_APARTMENT_THREADED
  3. #include <stdio.h>
  4. #include <atlbase.h>
  5. #include <atlcom.h>
  6. #include <sapi.h>
  7. class CSpeech
  8. {
  9. public:
  10. CSpeech();
  11. ~CSpeech();
  12. // speakContent为LPCTSTR型的字符串,调用此函数即可将文字转为语音
  13. static void MSSSpeak(LPCTSTR speakContent);
  14. static void SpeakIntXiaoyuWan(int new_num, bool is_after_wan = false);
  15. /*
  16. *读一个整数
  17. **/
  18. static void SpeakInt(int num);
  19. /*
  20. *把数字拆解成一个个的读音,调用wav文件播放
  21. *voice_type 1:收款成功 2:退款成功
  22. *num 金额,比如18.23
  23. **/
  24. static void SpeakNum(int voice_type, std::string num);
  25. };