bugfix(wn): fix the bug can not switch wake word model for esp32

This commit is contained in:
sxy 2022-08-12 21:10:01 +08:00
parent 4936d92ea8
commit 34e264eb5a
11 changed files with 8 additions and 28 deletions

View File

@ -29,14 +29,7 @@ ENDIF (IDF_VERSION_MAJOR GREATER 3)
multinet
dl_lib
c_speech_features
hilexin_wn5
hilexin_wn5X2
hilexin_wn5X3
nihaoxiaozhi_wn5
nihaoxiaozhi_wn5X2
nihaoxiaozhi_wn5X3
nihaoxiaoxin_wn5X3
customized_word_wn5
wakeword_model
multinet2_ch
esp_audio_processor
esp_audio_front_end

View File

@ -45,10 +45,6 @@ choice SR_WN_MODEL_LOAD
bool "Hi,Lexin (wn5_hilexin)"
depends on IDF_TARGET_ESP32
config SR_WN_WN5X2_HILEXIN
bool "Hi,Lexin (wn5_hilexinX2)"
depends on IDF_TARGET_ESP32
config SR_WN_WN5X3_HILEXIN
bool "Hi,Lexin (wn5_hilexinX3)"
depends on IDF_TARGET_ESP32
@ -57,10 +53,6 @@ choice SR_WN_MODEL_LOAD
bool "nihaoxiaozhi (wn5_nihaoxiaozhi)"
depends on IDF_TARGET_ESP32
config SR_WN_WN5X2_NIHAOXIAOZHI
bool "nihaoxiaozhi (wn5_nihaoxiaozhiX2)"
depends on IDF_TARGET_ESP32
config SR_WN_WN5X3_NIHAOXIAOZHI
bool "nihaoxiaozhi (wn5_nihaoxiaozhiX3)"
depends on IDF_TARGET_ESP32
@ -68,10 +60,6 @@ choice SR_WN_MODEL_LOAD
config SR_WN_WN5X3_NIHAOXIAOXIN
bool "nihaoxiaoxin (wn5_nihaoxiaoxinX3)"
depends on IDF_TARGET_ESP32
config SR_WN_WN5_CUSTOMIZED_WORD
bool "customized word (wn5_customizedword)"
depends on IDF_TARGET_ESP32
config SR_WN_WN8_ALEXA
bool "Alexa (wn8_alexa)"

View File

@ -31,6 +31,7 @@ typedef struct {
int total_ch_num; // total channel num. It must be: total_ch_num = mic_num + ref_num
int mic_num; // mic channel num
int ref_num; // reference channel num
int sample_rate; // sample rate of audio
} afe_pcm_config_t;
typedef struct {
@ -75,6 +76,7 @@ typedef struct {
.pcm_config.total_ch_num = 2, \
.pcm_config.mic_num = 1, \
.pcm_config.ref_num = 1, \
.pcm_config.sample_rate = 16000, \
}
#elif CONFIG_IDF_TARGET_ESP32S3
#define AFE_CONFIG_DEFAULT() { \
@ -97,5 +99,6 @@ typedef struct {
.pcm_config.total_ch_num = 3, \
.pcm_config.mic_num = 2, \
.pcm_config.ref_num = 1, \
.pcm_config.sample_rate = 16000, \
}
#endif

View File

@ -29,9 +29,8 @@ char *esp_mn_language_from_name(char *model_name);
/*
Configure wake word to use based on what's selected in menuconfig.
*/
#if defined CONFIG_USE_MULTINET
#if CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION
#ifdef CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION
#include "multinet2_ch.h"
#define MULTINET_COEFF get_coeff_multinet2_ch
#define MULTINET_MODEL_NAME "mn2_cn"
@ -41,10 +40,6 @@ char *esp_mn_language_from_name(char *model_name);
#define MULTINET_MODEL_NAME "NULL"
#endif
#else
#define MULTINET_COEFF "COEFF_NULL"
#define MULTINET_MODEL_NAME "NULL"
#endif
/* example

View File

@ -46,13 +46,14 @@ ns_handle_t ns_create(int frame_length);
* @warning frame_length only supports be 10 ms.
*
* @param frame_length The length of the audio processing can only be 10ms.
* @param mode 0: Mild, 1: Medium, 2: Aggressive
* @param mode 0: Mild, 1: Medium, 2: Aggressive
* @param sample_rate The sample rate of the audio.
*
* @return
* - NULL: Create failed
* - Others: The instance of NS
*/
ns_handle_t ns_pro_create(int frame_length, int mode);
ns_handle_t ns_pro_create(int frame_length, int mode, int sample_rate);
/**
* @brief Feed samples of an audio stream to the NS and get the audio stream after Noise suppression.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.