ttsTask.c 797 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "includes.h"
  2. OS_TID idTTSTask=0;
  3. U64 stkTTSTask[TTS_TASK_STK_SIZE];
  4. OS_SEM TTSonSem;
  5. TTS_DEF ttsVoice;
  6. void MeSpeak2()
  7. {
  8. os_sem_send(&TTSonSem);
  9. }
  10. void LocalTTSHandle(void)
  11. {
  12. char buf[15];
  13. if(ttsVoice.Update == 0) return;
  14. ModemSendAT("AT+LSHTTSSTP\r\n");
  15. os_dly_wait(30);
  16. sutPocStatus.TTS=1;
  17. SpeakerEnable();
  18. snprintf(buf, sizeof(buf), "AT+LSHTTS=%d,\"",ttsVoice.Languange);
  19. ModemSendAT(buf);
  20. if(ttsVoice.voiceStatic == NULL)
  21. ModemSendAT(ttsVoice.voice);
  22. else
  23. ModemSendAT(ttsVoice.voiceStatic);
  24. ModemSendAT("\"\r\n");
  25. ttsVoice.Update=0;
  26. os_dly_wait(30);
  27. }
  28. __task void TTSTask(void)
  29. {
  30. memset((unsigned char *)&ttsVoice, 0, sizeof(TTS_DEF));
  31. os_sem_init (&TTSonSem, 0);
  32. while(1)
  33. {
  34. os_sem_wait (&TTSonSem, 0xffff);
  35. //beepdi();
  36. }
  37. }