From a65d996583c72e0d77805bcbc36da580aacb2848 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 14 Feb 2023 14:30:53 +1100 Subject: Use the sync apis for I2S output --- src/audio/audio_decoder.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/audio/audio_decoder.cpp') diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp index d90ca496..97f45534 100644 --- a/src/audio/audio_decoder.cpp +++ b/src/audio/audio_decoder.cpp @@ -21,7 +21,7 @@ namespace audio { static const char* kTag = "DEC"; -static const std::size_t kSamplesPerChunk = 256; +static const std::size_t kSamplesPerChunk = 1024; AudioDecoder::AudioDecoder() : IAudioElement(), @@ -89,14 +89,12 @@ auto AudioDecoder::ProcessEndOfStream() -> void { needs_more_input_ = true; current_codec_.reset(); - SendOrBufferEvent( - std::unique_ptr( - StreamEvent::CreateEndOfStream(input_events_))); + SendOrBufferEvent(std::unique_ptr( + StreamEvent::CreateEndOfStream(input_events_))); } auto AudioDecoder::Process() -> cpp::result { if (has_samples_to_send_) { - ESP_LOGI(kTag, "sending samples"); // Writing samples is relatively quick (it's just a bunch of memcopy's), so // do them all at once. while (has_samples_to_send_ && !IsOverBuffered()) { @@ -132,7 +130,6 @@ auto AudioDecoder::Process() -> cpp::result { } if (!needs_more_input_) { - ESP_LOGI(kTag, "decoding frame"); auto res = current_codec_->ProcessNextFrame(); if (res.has_error()) { // todo -- cgit v1.2.3