feat: add debug mode

This commit is contained in:
xysun 2025-05-16 16:19:13 +08:00
parent e4c96d513d
commit 6b37c7fbc7
28 changed files with 54 additions and 5 deletions

View File

@ -143,7 +143,7 @@ build_esp_sr:
- .rules:build:test_esp_sr
parallel:
matrix:
- IMAGE: [espressif/idf:release-v5.4, espressif/idf:latest]
- IMAGE: [espressif/idf:v5.4.1, espressif/idf:latest]
EXAMPLES_PATH: "test_apps/esp-sr"
@ -153,7 +153,7 @@ build_esp_tts:
- .rules:build:test_esp_tts
parallel:
matrix:
- IMAGE: [espressif/idf:release-v5.4, espressif/idf:latest]
- IMAGE: [espressif/idf:v5.4.1, espressif/idf:latest]
EXAMPLES_PATH: "test_apps/esp-tts"
build_esp32c5:
@ -162,7 +162,7 @@ build_esp32c5:
- .rules:build:test_esp32c5
parallel:
matrix:
- IMAGE: [espressif/idf:release-v5.4, espressif/idf:latest]
- IMAGE: [espressif/idf:v5.4.1, espressif/idf:latest]
EXAMPLES_PATH: "test_apps/esp32c5"
.test_template: &test_template

View File

@ -1,5 +1,13 @@
# Change log for esp-sr
## unreleased
- Replace kissfft with dl_fft for wakenet9s
- Replace esp-dsp fft with dl_fft for wakenet9
## 2.1.2
- Add debug mode
- Update wakenet trigget to v4
## 2.1.1
- Add 8KHz AEC for VoIP
- Add more wakenet9 models

View File

@ -7,6 +7,7 @@ if((${IDF_TARGET} STREQUAL "esp32s3") OR (${IDF_TARGET} STREQUAL "esp32p4") OR (
set(srcs
"src/model_path.c"
"src/esp_sr_debug.c"
"src/esp_mn_speech_commands.c"
"src/esp_process_sdkconfig.c"
)
@ -42,10 +43,12 @@ if((${IDF_TARGET} STREQUAL "esp32s3") OR (${IDF_TARGET} STREQUAL "esp32p4") OR (
add_prebuilt_library(wakenet "${CMAKE_CURRENT_SOURCE_DIR}/lib/${IDF_TARGET}/libwakenet.a" PRIV_REQUIRES ${COMPONENT_NAME})
add_prebuilt_library(nsnet "${CMAKE_CURRENT_SOURCE_DIR}/lib/${IDF_TARGET}/libnsnet.a" PRIV_REQUIRES ${COMPONENT_NAME})
idf_component_get_property(esp_dsp_lib espressif__esp-dsp COMPONENT_LIB)
idf_component_get_property(dl_fft_lib espressif__dl_fft COMPONENT_LIB)
set(sr_libs
dl_lib
$<TARGET_FILE:${esp_dsp_lib}>
$<TARGET_FILE:${dl_fft_lib}>
c_speech_features
esp_audio_front_end
esp_audio_processor

View File

@ -1,9 +1,10 @@
version: "2.1.1"
version: "2.1.2"
description: esp_sr provides basic algorithms for Speech Recognition applications
url: https://github.com/espressif/esp-sr
dependencies:
idf: ">=5.0"
espressif/esp-dsp: "1.6.0"
espressif/dl_fft: ">=0.1.0"
files:
exclude:
- ".github"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +0,0 @@
wakenet9l_tts2h12_你好达蒙_3_0.634_0.640

12
src/esp_sr_debug.c Normal file
View File

@ -0,0 +1,12 @@
// debug.c
#include "esp_sr_debug.h"
static int debug_enabled = 0;
void esp_sr_set_debug_mode(int enabled) {
debug_enabled = enabled ? 1 : 0;
}
int esp_sr_get_debug_mode(void) {
return debug_enabled;
}

View File

@ -0,0 +1,26 @@
#pragma once
/**
* @brief Set the debug mode for esp-sr component.
*
* @param enabled Flag to control debug mode:
* - 1: Enable debug mode (output debug information)
* - 0: Disable debug mode
*
* @note This setting affects the verbosity of debug output from the esp-sr component.
* Debug information may include processing details, intermediate results, etc.
*/
void esp_sr_set_debug_mode(int enabled);
/**
* @brief Get the current debug mode status of esp-sr component.
*
* @return Current debug mode status:
* - 1: Debug mode is enabled
* - 0: Debug mode is disabled
*
* @note This function can be used to check whether debug output is currently active
* before performing potentially expensive debug logging operations.
*/
int esp_sr_get_debug_mode(void);