You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

63 lines
1.3 KiB

#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <iostream>
#include <WinSock2.h>
//#include <WS2tcpip.h>
#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