feat(i18n): finish zh-CN example comments and align Strapping term with the glossary
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d79051250
commit
2b73b57ee6
12 files changed
+84
-84
No files matched your search
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Exemplo ESP-SR para ESP32-S3 / ESP32-P4
|
||||
* Reconhecimento de Fala Local Offline (WakeNet + MultiNet)
|
||||
* 面向 ESP32-S3 / ESP32-P4 的 ESP-SR 示例
|
||||
* 离线本地语音识别(WakeNet + MultiNet)
|
||||
*
|
||||
* Dependência (idf_component.yml):
|
||||
* 依赖(idf_component.yml):
|
||||
* espressif/esp-sr: "^1.5.0"
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ void feed_audio_task(void *arg)
|
||||
int16_t *feed_buff = (int16_t *)malloc(audio_chunksize * sizeof(int16_t) * 2);
|
||||
|
||||
while (1) {
|
||||
// Leitura de áudio I2S dos microfones da placa
|
||||
// 从开发板麦克风读取 I2S 音频
|
||||
// i2s_read(I2S_NUM_0, feed_buff, ...);
|
||||
|
||||
afe_handle->feed(afe_data, feed_buff);
|
||||
@@ -42,7 +42,7 @@ void speech_recognition_task(void *arg)
|
||||
esp_afe_sr_data_t *afe_data = (esp_afe_sr_data_t *)arg;
|
||||
const esp_afe_sr_iface_t *afe_handle = &ESP_AFE_SR_HANDLE;
|
||||
|
||||
// Inicializa o modelo de comandos de fala (MultiNet)
|
||||
// 初始化语音命令模型(MultiNet)
|
||||
const esp_mn_iface_t *multinet = &ESP_MN_HANDLE;
|
||||
model_iface_data_t *model_data = multinet->create(&MULTINET_MODEL, 6000);
|
||||
|
||||
@@ -54,12 +54,12 @@ void speech_recognition_task(void *arg)
|
||||
continue;
|
||||
}
|
||||
|
||||
// 1. Verificação de Wake Word (Palavra de ativação)
|
||||
// 1. 唤醒词(Wake Word)检测
|
||||
if (res->wake_word_detected == WAKENET_DETECTED) {
|
||||
ESP_LOGW(TAG, ">>> PALAVRA-CHAVE DETECTADA! Canal de escuta aberto.");
|
||||
}
|
||||
|
||||
// 2. Reconhecimento de comando local
|
||||
// 2. 本地命令识别
|
||||
if (res->raw_data_size > 0) {
|
||||
esp_mn_state_t mn_state = multinet->detect(model_data, res->data);
|
||||
|
||||
@@ -67,7 +67,7 @@ void speech_recognition_task(void *arg)
|
||||
esp_mn_results_t *mn_res = multinet->get_results(model_data);
|
||||
ESP_LOGI(TAG, ">>> COMANDO RECONHECIDO: ID #%d (Frase correspondente)", mn_res->command_id[0]);
|
||||
|
||||
// Exemplo de ação
|
||||
// 操作示例
|
||||
if (mn_res->command_id[0] == 1) {
|
||||
ESP_LOGI(TAG, "Ação: Ligar Luz da Sala");
|
||||
} else if (mn_res->command_id[0] == 2) {
|
||||
@@ -85,14 +85,14 @@ void app_main(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "Iniciando ESP-SR Speech Recognition Engine");
|
||||
|
||||
// Configura o pipeline de Audio Front-End (AEC, BSS, VAD, WakeNet)
|
||||
// 配置音频前端流水线(AEC、BSS、VAD、WakeNet)
|
||||
afe_config_t afe_config = AFE_CONFIG_DEFAULT();
|
||||
afe_config.wakenet_init = true;
|
||||
afe_config.voice_communication_init = false;
|
||||
|
||||
esp_afe_sr_data_t *afe_data = ESP_AFE_SR_HANDLE.create_from_config(&afe_config);
|
||||
|
||||
// Cria as tarefas de alimentação de áudio e reconhecimento
|
||||
// 创建音频输入和识别任务
|
||||
xTaskCreatePinnedToCore(feed_audio_task, "feed_task", 4096, afe_data, 5, NULL, 0);
|
||||
xTaskCreatePinnedToCore(speech_recognition_task, "sr_task", 8192, afe_data, 5, NULL, 1);
|
||||
}
|
||||
Reference in new issue
Block a user