|
xt-sdk 文档 v1.0.3
xt-sdk 嵌入式 SDK API 参考
|
音频设备抽象层(普通用户接口) 更多...
结构体 | |
| struct | xt_audio_dev_cb_info |
| 音频设备回调信息结构体 更多... | |
| struct | xt_audio_dev_info |
| 音频设备操作信息结构体 更多... | |
| struct | xt_audio_dev_config |
| 音频设备配置结构体 更多... | |
宏定义 | |
| #define | xt_audio_dev_stop(_hdl) |
| #define | xt_audio_dev_read_stop(_hdl) |
| #define | xt_audio_dev_write(_hdl, _data, _size, _level) |
| #define | xt_audio_dev_read(_hdl, _data, _size, _level) |
类型定义 | |
| typedef void(* | xt_audio_dev_evt_cb_t) (xt_audio_t hdl, enum xt_audio_dev_evt evt, struct xt_audio_dev_cb_info *info) |
| 音频设备事件回调函数类型 | |
函数 | |
| xt_err_t | xt_audio_dev_setup (struct xt_audio_dev_config *cfg, xt_audio_t *hdl) |
| 初始化音频设备 | |
| xt_err_t | xt_audio_dev_close (xt_audio_t hdl) |
| 关闭音频设备 | |
| xt_err_t | xt_audio_dev_stop_ext (xt_audio_t hdl, xt_audio_mode_t mode) |
| 停止音频设备指定方向的传输 | |
| int | xt_audio_dev_write_ext (xt_audio_t hdl, uint8_t *data, uint32_t size, struct xt_audio_dev_info *info) |
| 向音频设备写入数据(扩展版本) | |
| int | xt_audio_dev_read_ext (xt_audio_t hdl, uint8_t *data, uint32_t size, struct xt_audio_dev_info *info) |
| 从音频设备读取数据(扩展版本) | |
| int | xt_audio_dev_read_start_ext (xt_audio_t hdl, struct xt_audio_dev_info *info) |
| 启动音频设备读取(扩展版本) | |
| xt_err_t | xt_audio_dev_get_format (xt_audio_t hdl, struct xt_audio_format *fmt) |
| 获取音频设备当前格式 | |
| uint16_t | xt_audio_dev_get_frame_interval (xt_audio_t hdl) |
| 获取帧间隔时间 | |
| xt_err_t | xt_audio_dev_sleep (xt_audio_t hdl) |
| 音频设备进入休眠 | |
| xt_err_t | xt_audio_dev_resume (xt_audio_t hdl) |
| 音频设备从休眠恢复 | |
| xt_err_t | xt_audio_dev_register_drv (struct xt_audio_dev_drv *drv) |
| 注册音频设备驱动 | |
| struct xt_audio_dev_drv * | xt_audio_dev_get_drv (const char *name) |
| 按名称获取已注册的音频驱动 | |
音频设备抽象层(普通用户接口)
| #define xt_audio_dev_read | ( | _hdl, | |
| _data, | |||
| _size, | |||
| _level ) |
在文件 xt_audio_dev.h 第 156 行定义.
| #define xt_audio_dev_read_stop | ( | _hdl | ) |
在文件 xt_audio_dev.h 第 120 行定义.
| #define xt_audio_dev_stop | ( | _hdl | ) |
在文件 xt_audio_dev.h 第 119 行定义.
| #define xt_audio_dev_write | ( | _hdl, | |
| _data, | |||
| _size, | |||
| _level ) |
在文件 xt_audio_dev.h 第 133 行定义.
| typedef void(* xt_audio_dev_evt_cb_t) (xt_audio_t hdl, enum xt_audio_dev_evt evt, struct xt_audio_dev_cb_info *info) |
音频设备事件回调函数类型
| hdl | 音频设备句柄 |
| evt | 事件类型,见 xt_audio_dev_evt |
| info | 回调信息,见 xt_audio_dev_cb_info |
在文件 xt_audio_dev.h 第 63 行定义.
| enum xt_audio_dev_evt |
音频设备事件枚举
在文件 xt_audio_dev.h 第 37 行定义.
| xt_err_t xt_audio_dev_close | ( | xt_audio_t | hdl | ) |
| struct xt_audio_dev_drv * xt_audio_dev_get_drv | ( | const char * | name | ) |
按名称获取已注册的音频驱动
| name | 驱动名称 |
| xt_err_t xt_audio_dev_get_format | ( | xt_audio_t | hdl, |
| struct xt_audio_format * | fmt ) |
| uint16_t xt_audio_dev_get_frame_interval | ( | xt_audio_t | hdl | ) |
获取帧间隔时间
| hdl | 设备句柄 |
| int xt_audio_dev_read_ext | ( | xt_audio_t | hdl, |
| uint8_t * | data, | ||
| uint32_t | size, | ||
| struct xt_audio_dev_info * | info ) |
从音频设备读取数据(扩展版本)
| hdl | 设备句柄 |
| data | 数据缓冲区 |
| size | 缓冲区大小(字节) |
| info | 操作信息,见 xt_audio_dev_info |
| int xt_audio_dev_read_start_ext | ( | xt_audio_t | hdl, |
| struct xt_audio_dev_info * | info ) |
| xt_err_t xt_audio_dev_register_drv | ( | struct xt_audio_dev_drv * | drv | ) |
| xt_err_t xt_audio_dev_resume | ( | xt_audio_t | hdl | ) |
| xt_err_t xt_audio_dev_setup | ( | struct xt_audio_dev_config * | cfg, |
| xt_audio_t * | hdl ) |
| xt_err_t xt_audio_dev_sleep | ( | xt_audio_t | hdl | ) |
| xt_err_t xt_audio_dev_stop_ext | ( | xt_audio_t | hdl, |
| xt_audio_mode_t | mode ) |
| int xt_audio_dev_write_ext | ( | xt_audio_t | hdl, |
| uint8_t * | data, | ||
| uint32_t | size, | ||
| struct xt_audio_dev_info * | info ) |
向音频设备写入数据(扩展版本)
| hdl | 设备句柄 |
| data | 音频数据 |
| size | 数据大小(字节) |
| info | 操作信息(可设置音量等参数),见 xt_audio_dev_info |