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() {
152
152
153
153
bool AudioService::ReadAudioData (std::vector<int16_t >& data, int sample_rate, int samples) {
154
154
if (!codec_->input_enabled ()) {
155
- codec_-> EnableInput ( true );
155
+ esp_timer_stop (audio_power_timer_ );
156
156
esp_timer_start_periodic (audio_power_timer_, AUDIO_POWER_CHECK_INTERVAL_MS * 1000 );
157
+ codec_->EnableInput (true );
157
158
}
158
159
159
160
if (codec_->input_sample_rate () != sample_rate) {
@@ -287,8 +288,9 @@ void AudioService::AudioOutputTask() {
287
288
lock.unlock ();
288
289
289
290
if (!codec_->output_enabled ()) {
290
- codec_-> EnableOutput ( true );
291
+ esp_timer_stop (audio_power_timer_ );
291
292
esp_timer_start_periodic (audio_power_timer_, AUDIO_POWER_CHECK_INTERVAL_MS * 1000 );
293
+ codec_->EnableOutput (true );
292
294
}
293
295
codec_->OutputData (task->pcm );
294
296
You can’t perform that action at this time.
0 commit comments