File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,9 @@ void AudioService::Stop() {
152152
153153bool AudioService::ReadAudioData (std::vector<int16_t >& data, int sample_rate, int samples) {
154154 if (!codec_->input_enabled ()) {
155- codec_-> EnableInput ( true );
155+ esp_timer_stop (audio_power_timer_ );
156156 esp_timer_start_periodic (audio_power_timer_, AUDIO_POWER_CHECK_INTERVAL_MS * 1000 );
157+ codec_->EnableInput (true );
157158 }
158159
159160 if (codec_->input_sample_rate () != sample_rate) {
@@ -287,8 +288,9 @@ void AudioService::AudioOutputTask() {
287288 lock.unlock ();
288289
289290 if (!codec_->output_enabled ()) {
290- codec_-> EnableOutput ( true );
291+ esp_timer_stop (audio_power_timer_ );
291292 esp_timer_start_periodic (audio_power_timer_, AUDIO_POWER_CHECK_INTERVAL_MS * 1000 );
293+ codec_->EnableOutput (true );
292294 }
293295 codec_->OutputData (task->pcm );
294296
You can’t perform that action at this time.
0 commit comments