|
Emakefun TTS 2.1
|
语音合成模块 更多...
#include <tts.h>
Public 类型 | |
| enum | ErrorCode : uint32_t { kOK = 0 , kI2cDataTooLongToFitInTransmitBuffer = 1 , kI2cReceivedNackOnTransmitOfAddress = 2 , kI2cReceivedNackOnTransmitOfData = 3 , kI2cOtherError = 4 , kI2cTimeout = 5 , kInvalidParameter = 6 , kUnknownError = 7 } |
| 错误码 更多... | |
| enum | TextEncodingType : uint8_t { kGb23212 = 0x00 , kGbk = 0x01 , kBig5 = 0x02 , kUtf16le = 0x03 , kUtf8 = 0x04 } |
| 文本编码类型 更多... | |
Public 成员函数 | |
| Tts (const uint8_t i2c_address=kDefaultI2cAddress, TwoWire &wire=Wire) | |
| 构造函数 | |
| Tts (TwoWire &wire) | |
| ErrorCode | Initialize () |
| 初始化函数 | |
| ErrorCode | Play (const String &text, const TextEncodingType text_encoding_type=kUtf8) |
| 文本转语音并播放 | |
| ErrorCode | PlayFromCache (const TextEncodingType text_encoding_type=kUtf8, uint8_t count=kMinSpeechCount) |
| 从缓存块0的文本开始转语音并播放 | |
| ErrorCode | PushTextToCache (const String &text, const uint8_t cache_index) |
| 将文本内容上传到指定缓存块 | |
| ErrorCode | Stop () |
| 停止播放 | |
| ErrorCode | Pause () |
| 暂停播放 | |
| ErrorCode | Resume () |
| 恢复播放 | |
语音合成模块
| enum emakefun::Tts::ErrorCode : uint32_t |
| enum emakefun::Tts::TextEncodingType : uint8_t |
|
explicit |
构造函数
| di2c_address | 语音合成模块I2C地址,默认为0x40 |
| ErrorCode emakefun::Tts::Play | ( | const String & | text, |
| const TextEncodingType | text_encoding_type = kUtf8 ) |
文本转语音并播放
| [in] | text | 文本数据,数据长度不大于250个字节 |
| [in] | text_encoding_type | 文本编码类型,参考 TextEncodingType, 默认为 kUtf8 |
| ErrorCode emakefun::Tts::PlayFromCache | ( | const TextEncodingType | text_encoding_type = kUtf8, |
| uint8_t | count = kMinSpeechCount ) |
| ErrorCode emakefun::Tts::PushTextToCache | ( | const String & | text, |
| const uint8_t | cache_index ) |