xt-sdk 文档 v1.0.3
xt-sdk 嵌入式 SDK API 参考
载入中...
搜索中...
未找到
xt_audio_tts.h
浏览该文件的文档.
1
10
11#ifndef __XT_AUDIO_TTS_H__
12#define __XT_AUDIO_TTS_H__
13
14/* ==================== [Includes] ========================================== */
15
16#include "xt_audio_types.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
28
29/* ==================== [Defines] =========================================== */
30
31/* ==================== [Typedefs] ========================================== */
32
36typedef struct xt_audio_tts *xt_audio_tts_t;
37
49
54 void *user_data;
55 uint8_t *data;
56 uint32_t size;
57 uint8_t prior;
58 int level;
60};
61
69typedef void (*xt_audio_tts_cb_t)(xt_audio_t hdl, enum xt_audio_tts_evt evt,
70 struct xt_audio_tts_cb_info *info);
71
81
92
100
101/* ==================== [Global Prototypes] ================================= */
102
112
121
129
139int xt_audio_tts_play_ext(xt_audio_t hdl, const char *text, uint32_t size, struct xt_audio_tts_info *info);
140
141#define xt_audio_tts_play(_hdl, _text, _size, _prior, _level) \
142 xt_audio_tts_play_ext(_hdl, _text, _size, &((struct xt_audio_tts_info){.prior = _prior, .level = _level}))
143
151
159
160/* ==================== [Macros] ============================================ */
161 /* xt_audio_tts */
163
164#ifdef __cplusplus
165} /* extern "C" */
166#endif
167
168#endif /* __XT_AUDIO_TTS_H__ */
struct xt_audio_tts * xt_audio_tts_t
TTS 实例句柄类型
xt_err_t xt_audio_tts_setup(struct xt_audio_tts_config *cfg, xt_audio_t *hdl)
初始化 TTS 模块
void(* xt_audio_tts_cb_t)(xt_audio_t hdl, enum xt_audio_tts_evt evt, struct xt_audio_tts_cb_info *info)
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 播放
xt_err_t xt_audio_tts_close(xt_audio_t hdl)
关闭 TTS 模块
xt_tts_res_location
TTS 资源位置类型枚举
xt_audio_tts_evt
TTS 事件枚举
int xt_audio_tts_is_stopping(xt_audio_t hdl)
查询 TTS 是否正在停止
xt_err_t xt_audio_tts_set_resource_location(enum xt_tts_res_location loc, char *part_name)
设置 TTS 资源位置
@ XT_AUDIO_TTS_RES_LOC_INTERNAL
@ XT_AUDIO_TTS_RES_LOC_EXTERNAL
@ XT_AUDIO_TTS_EVT_NO_ERR
@ XT_AUDIO_TTS_EVT_SYNTHESIZE_CHUNK
@ XT_AUDIO_TTS_EVT_SYNTHESIZE_ABORT
@ _XT_AUDIO_TTS_EVT_MAX
@ XT_AUDIO_TTS_EVT_SYNTHESIZE_ERROR
@ XT_AUDIO_TTS_EVT_SYNTHESIZE_CMPLT
void * xt_audio_t
音频设备句柄类型
int32_t xt_err_t
错误码类型
音频格式描述结构体
TTS 回调信息结构体
struct xt_audio_format fmt
TTS 配置结构体
xt_audio_tts_cb_t user_cb
TTS 播放扩展参数结构体
xt_audio_tts_cb_t user_cb
XTINY 音频公共类型定义