fix: voice interupt
This commit is contained in:
@ -579,6 +579,7 @@ void AudioService::EnableWakeWordDetection(bool enable) {
|
||||
void AudioService::EnableVoiceProcessing(bool enable) {
|
||||
ESP_LOGD(TAG, "%s voice processing", enable ? "Enabling" : "Disabling");
|
||||
if (enable) {
|
||||
bool was_running = IsAudioProcessorRunning();
|
||||
if (!audio_processor_initialized_) {
|
||||
audio_processor_->Initialize(codec_, OPUS_FRAME_DURATION_MS, models_list_);
|
||||
audio_processor_initialized_ = true;
|
||||
@ -586,7 +587,7 @@ void AudioService::EnableVoiceProcessing(bool enable) {
|
||||
|
||||
/* We should make sure no audio is playing */
|
||||
ResetDecoder();
|
||||
audio_input_need_warmup_ = true;
|
||||
audio_input_need_warmup_ = !was_running;
|
||||
// Reset input resampler to clear cached data from previous mode (e.g. WakeWord)
|
||||
// This prevents buffer overflow when switching between different feed sizes
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user