|
xt-sdk 文档 v1.0.3
xt-sdk 嵌入式 SDK API 参考
|
XTINY 音频 TTS 合成模块接口 更多...
结构体 | |
| struct | xt_audio_tts_cb_info |
| TTS 回调信息结构体 更多... | |
| struct | xt_audio_tts_info |
| TTS 播放扩展参数结构体 更多... | |
| struct | xt_audio_tts_config |
| TTS 配置结构体 更多... | |
宏定义 | |
| #define | xt_audio_tts_play(_hdl, _text, _size, _prior, _level) |
类型定义 | |
| typedef struct xt_audio_tts * | xt_audio_tts_t |
| TTS 实例句柄类型 | |
| typedef void(* | xt_audio_tts_cb_t) (xt_audio_t hdl, enum xt_audio_tts_evt evt, struct xt_audio_tts_cb_info *info) |
| TTS 回调函数类型 | |
枚举 | |
| enum | xt_audio_tts_evt { XT_AUDIO_TTS_EVT_NO_ERR , XT_AUDIO_TTS_EVT_SYNTHESIZE_CHUNK , XT_AUDIO_TTS_EVT_SYNTHESIZE_CMPLT , XT_AUDIO_TTS_EVT_SYNTHESIZE_ABORT , XT_AUDIO_TTS_EVT_SYNTHESIZE_ERROR , _XT_AUDIO_TTS_EVT_MAX } |
| TTS 事件枚举 更多... | |
| enum | xt_tts_res_location { XT_AUDIO_TTS_RES_LOC_INTERNAL = 0 , XT_AUDIO_TTS_RES_LOC_EXTERNAL } |
| TTS 资源位置类型枚举 更多... | |
函数 | |
| xt_err_t | xt_audio_tts_set_resource_location (enum xt_tts_res_location loc, char *part_name) |
| 设置 TTS 资源位置 | |
| xt_err_t | xt_audio_tts_setup (struct xt_audio_tts_config *cfg, xt_audio_t *hdl) |
| 初始化 TTS 模块 | |
| xt_err_t | xt_audio_tts_close (xt_audio_t hdl) |
| 关闭 TTS 模块 | |
| int | xt_audio_tts_play_ext (xt_audio_t hdl, const char *text, uint32_t size, struct xt_audio_tts_info *info) |
| TTS 播放(扩展版本) | |
| xt_err_t | xt_audio_tts_stop (xt_audio_t hdl) |
| 停止 TTS 播放 | |
| int | xt_audio_tts_is_stopping (xt_audio_t hdl) |
| 查询 TTS 是否正在停止 | |
XTINY 音频 TTS 合成模块接口
| #define xt_audio_tts_play | ( | _hdl, | |
| _text, | |||
| _size, | |||
| _prior, | |||
| _level ) |
在文件 xt_audio_tts.h 第 141 行定义.
| typedef void(* xt_audio_tts_cb_t) (xt_audio_t hdl, enum xt_audio_tts_evt evt, struct xt_audio_tts_cb_info *info) |
TTS 回调函数类型
| hdl | 音频设备句柄 |
| evt | TTS 事件,见 xt_audio_tts_evt |
| info | 回调信息,见 xt_audio_tts_cb_info |
在文件 xt_audio_tts.h 第 69 行定义.
| typedef struct xt_audio_tts* xt_audio_tts_t |
TTS 实例句柄类型
在文件 xt_audio_tts.h 第 36 行定义.
| enum xt_audio_tts_evt |
TTS 事件枚举
在文件 xt_audio_tts.h 第 41 行定义.
| enum xt_tts_res_location |
TTS 资源位置类型枚举
| 枚举值 | |
|---|---|
| XT_AUDIO_TTS_RES_LOC_INTERNAL | 内部资源(默认) |
| XT_AUDIO_TTS_RES_LOC_EXTERNAL | 外置 Flash |
在文件 xt_audio_tts.h 第 96 行定义.
| xt_err_t xt_audio_tts_close | ( | xt_audio_t | hdl | ) |
| int xt_audio_tts_is_stopping | ( | xt_audio_t | hdl | ) |
查询 TTS 是否正在停止
| hdl | TTS 句柄 |
| int xt_audio_tts_play_ext | ( | xt_audio_t | hdl, |
| const char * | text, | ||
| uint32_t | size, | ||
| struct xt_audio_tts_info * | info ) |
TTS 播放(扩展版本)
| hdl | TTS 句柄 |
| text | UTF-8 文本 |
| size | 文本字节数 |
| info | 扩展参数(可为 NULL),见 xt_audio_tts_info |
| xt_err_t xt_audio_tts_set_resource_location | ( | enum xt_tts_res_location | loc, |
| char * | part_name ) |
设置 TTS 资源位置
| loc | 资源位置,见 xt_tts_res_location |
| part_name | 外置 Flash 分区名,仅当 loc 为 XT_AUDIO_TTS_RES_LOC_EXTERNAL 时有效, 传入 NULL 时使用默认分区 "ext_tts" |
| xt_err_t xt_audio_tts_setup | ( | struct xt_audio_tts_config * | cfg, |
| xt_audio_t * | hdl ) |
| xt_err_t xt_audio_tts_stop | ( | xt_audio_t | hdl | ) |