#include #include #include #include #include #include //#include //#pragma comment( lib, "ws2_32" ) //#pragma comment(lib,"winmm") //#include "include/loadSdkDll.h" #include "sds/interface/macros.h" #include "sds/interface/speech_sds.h" //??????? #ifndef LX_DLL_CLASS_EXPORTS #define CPP_DLL_API __declspec(dllexport) #else #define CPP_DLL_API __declspec(dllimport) #endif namespace mobvoi { namespace sds { class CPP_DLL_API OnlineTtsHelper { public: static OnlineTtsHelper* GetInstance(); void SetTtsParas( std::string language, std::string speaker, std::string speed); bool StartTts(std::string ttsContent); bool StopTts(); private: bool Run(int argc, char* argv[]); bool ParseCmdArgs(int argc, char* argv[]); bool InitEnv(); bool GetService(); bool ReleaseService(); bool ReleaseEnv(); bool InvokeSetParams(); bool InvokeStart(); bool InvokeFeedText(std::string text); bool InvokeReadTtsData(); bool InvokeStop(); void PlayTts(std::string fullName); private: SpeechSDS* speech_sds_; std::string base_dir_; Service* service_; std::string ttsContent_; std::string language_; std::string speaker_; std::string speed_; bool finishTts_; OnlineTtsHelper() : speech_sds_(nullptr), service_(nullptr) {} ~OnlineTtsHelper() {} DISALLOW_COPY_AND_ASSIGN(OnlineTtsHelper); }; } // namespace sds } // namespace mobvoi