summaryrefslogtreecommitdiff
path: root/src/audio/audio_decoder.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-02-14 14:30:53 +1100
committerjacqueline <me@jacqueline.id.au>2023-02-14 14:30:53 +1100
commita65d996583c72e0d77805bcbc36da580aacb2848 (patch)
treeee64bb43ff2f44f495942e50e77176476b71f7b5 /src/audio/audio_decoder.cpp
parentfa1f1cd9aba914882b95e93cdf64ad01309aa633 (diff)
downloadtangara-fw-a65d996583c72e0d77805bcbc36da580aacb2848.tar.gz
Use the sync apis for I2S output
Diffstat (limited to 'src/audio/audio_decoder.cpp')
-rw-r--r--src/audio/audio_decoder.cpp9
1 files changed, 3 insertions, 6 deletions
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>(
- StreamEvent::CreateEndOfStream(input_events_)));
+ SendOrBufferEvent(std::unique_ptr<StreamEvent>(
+ StreamEvent::CreateEndOfStream(input_events_)));
}
auto AudioDecoder::Process() -> cpp::result<void, AudioProcessingError> {
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<void, AudioProcessingError> {
}
if (!needs_more_input_) {
- ESP_LOGI(kTag, "decoding frame");
auto res = current_codec_->ProcessNextFrame();
if (res.has_error()) {
// todo