| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- /*************************************************************************
- 【文件名】 TtsInterface.h
- 【功能模块和目的】 TTS模块导出接口
- 【开发者及日期】 郑石诺 2015/10/08
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- #ifdef TTSINTERFACE_EXPORTS
- #define TTSINTERFACE_API __declspec(dllexport)
- #else
- #define TTSINTERFACE_API __declspec(dllimport)
- #endif
- #define TTS_ITEM(item, idx, comment) item = idx
- enum TTS_TYPE
- {
- TTS_ITEM(TTS_NONE, 0, "不启用TTS"),
- TTS_ITEM(TTS_IFLY, 1, "科大讯飞"),
- TTS_ITEM(TTS_JT, 2, "捷通华声"),
- TTS_ITEM(TTS_IBM, 3, "IBM")
- };
- // 定义数字播报格式
- #define TTS_RN_AUTO_VALUE 0 /* Auto, read as value if not sure */
- #define TTS_RN_VALUE 1 /* Read as value */
- #define TTS_RN_DIGIT 2 /* Read as string */
- #define TTS_RN_AUTO_DIGIT 3 /* Auto, read as string if not sure */
- /*************************************************************************
- 【类名】 CTtsInterface
- 【功能】
- 【接口说明】 TTS功能接口
- 【开发者及日期】 郑石诺 2015/10/08
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class TTSINTERFACE_API ITtsInterface
- {
- public:
- virtual ~ITtsInterface(void) = 0 {}
- static ITtsInterface& getInstance(void);
- virtual bool init(TTS_TYPE TtsType, LPCSTR BufferPath, LPTSTR ErrorInfo) = 0;
- virtual void close(void) = 0;
- virtual bool setTTSParam(int NumReadType, int Speed, int Volume) = 0;
- virtual bool string2Audio(LPTSTR Text, LPTSTR AudioName, int Len) = 0;
- virtual bool file2Audio(LPTSTR FileName, LPTSTR AudioName, int Len) = 0;
- };
|