语音识别模块类
更多...
#include <speech_recognizer.h>
|
|
static constexpr uint8_t | kDefaultI2cAddress = 0x30 |
| | 语音识别模块默认I2C地址
|
| |
|
static constexpr uint8_t | kMaxKeywordDataBytes = 50 |
| | 每条关键词最大字符数
|
| |
◆ Event
事件类型
| 枚举值 |
|---|
| kEventNone | 无事件
|
| kEventStartWaitingForTrigger | 开始等待触发
|
| kEventButtonTriggered | 被按键触发
|
| kEventKeywordTriggered | 被关键词触发
|
| kEventStartRecognizing | 开始识别
|
| kEventSpeechRecognized | 识别成功
|
| kEventSpeechRecognitionTimedOut | 识别超时
|
◆ RecognitionMode
识别模式
| 枚举值 |
|---|
| kRecognitionAuto | 自动识别模式
|
| kButtonTrigger | 按键触发识别模式
|
| kKeywordTrigger | 关键词触发识别模式
|
| kKeywordOrButtonTrigger | 按键或关键词触发识别模式
|
◆ SpeechRecognizer()
| emakefun::SpeechRecognizer::SpeechRecognizer |
( |
const uint8_t |
i2c_address = kDefaultI2cAddress | ) |
|
构造函数
- 参数
-
| i2c_address | 语音识别模块I2C地址,默认为0x30 |
◆ AddKeyword()
| void emakefun::SpeechRecognizer::AddKeyword |
( |
const uint8_t |
index, |
|
|
const String & |
keyword |
|
) |
| |
◆ GetEvent()
◆ Initialize()
| int32_t emakefun::SpeechRecognizer::Initialize |
( |
TwoWire *const |
wire = &Wire | ) |
|
◆ Recognize()
| int16_t emakefun::SpeechRecognizer::Recognize |
( |
| ) |
|
◆ SetRecognitionMode()
| void emakefun::SpeechRecognizer::SetRecognitionMode |
( |
const RecognitionMode |
recognition_mode | ) |
|
◆ SetTimeout()
| void emakefun::SpeechRecognizer::SetTimeout |
( |
const uint32_t |
timeout_ms | ) |
|
该类的文档由以下文件生成: