#include #include #include #include #include #include //#include #pragma comment( lib, "ws2_32" ) #pragma comment(lib,"winmm") #include "include/loadSdkDll.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 OnlineTtsDemo { public: static OnlineTtsDemo* GetInstance(); void setTtsParas(std::string ttsContent, std::string language, std::string speaker, std::string speed); bool Run(int argc, char* argv[]); private: 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_; OnlineTtsDemo() : speech_sds_(nullptr), service_(nullptr) {} ~OnlineTtsDemo() {} DISALLOW_COPY_AND_ASSIGN(OnlineTtsDemo); }; } // namespace sds } // namespace mobvoi