espressif / esp-sr

Speech recognition
Other
576 stars 106 forks source link

Voice Activity Detection (VAD) and Automatic Gain Control (AGC) functionality simultaneously (AIS-1530) #93

Closed PrathamG closed 8 months ago

PrathamG commented 8 months ago

Hi! If I understand correctly, we can currently only use VAD with ESP_AFE_SR_HANDLE and AGC with ESP_AFE_VC_HANDLE. I have a use case where I want to first carry out VAD on the input stream, and if VAD is true, carry out AGC for some data processing. Is it possible to implement AGC and VAD at the same time? I am not using the wakenet because I do not need it in my application flow.

Thanks!

sun-xiangyu commented 8 months ago

Hi @PrathamG , The AGC of ESP_AFE_SR_HANDLE is enabled by default. You can modify agc_mode to control the output gain. Please refer to afe_mn_peak_agc_mode_t agc_mode for more details.

NOTE: the gain of AGC in ESP_AFE_SR_HANDLE is calculated by wake word engine(wakenet). So the AGC in ESP_AFE_SR_HANDLE only works when a wake word is triggered.

PrathamG commented 8 months ago

Thanks @sun-xiangyu ! So currently it's not possible to use the AGC of ESP_AFE_SR_HANDLE without enabling the wakenet, is that correct?

sun-xiangyu commented 8 months ago

Yes, you only can set a fix gain by float afe_linear_gain.

PrathamG commented 8 months ago

Okay, thanks.