ttschannel.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef TTSCHANNEL_H
  2. #define TTSCHANNEL_H
  3. #include "thread.h"
  4. #include "CCarLifeLibWrapper.h"
  5. using namespace CommonUtilH;
  6. using namespace CCarLifeLibH;
  7. class MediaDecode;
  8. class TTSChannel : public Thread
  9. {
  10. public:
  11. virtual ~TTSChannel();
  12. static TTSChannel *instance();
  13. bool soundStart() const
  14. {
  15. return mSoundStart;
  16. }
  17. void setSoundStart(bool start)
  18. {
  19. mSoundStart = start;
  20. }
  21. MediaDecode *decoder()
  22. {
  23. return mDecoder;
  24. }
  25. void SetTTSInfoCallback(void (*callback)(unsigned char*, int ,void*), void *parameter);
  26. void SetTTSStartCallback(void (*callback)(bool,int,int,int, int, void*), void *parameter);
  27. protected:
  28. virtual void run(); //线程执行函数
  29. private:
  30. TTSChannel();
  31. //数据接收回调函数
  32. static void recvInit(S_AUDIO_INIT_PARAMETER *); //接收手机端发送给车机端的tts初始化信息
  33. static void recvNormalData(u8 *data, u32 len); //接收车机端接收手机端发送的tts数据
  34. static void recvStop(); //接收手机端通知车机端tts停止状态
  35. private:
  36. static TTSChannel *mInstance;
  37. MediaDecode *mDecoder;
  38. bool mSoundStart;
  39. static int mValue;
  40. void (*m_tts_info_callback)(unsigned char*,int,void*);
  41. void (*m_tts_start_callback)(bool,int,int,int,int,void*);
  42. void *m_parameter;
  43. };
  44. #endif // TTSCHANNEL_H