diff options
Diffstat (limited to 'src/codecs')
| -rw-r--r-- | src/codecs/wav.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/codecs/wav.cpp b/src/codecs/wav.cpp index 652f4f88..22cbd49c 100644 --- a/src/codecs/wav.cpp +++ b/src/codecs/wav.cpp @@ -199,7 +199,7 @@ auto WavDecoder::OpenStream(std::shared_ptr<IStream> input,uint32_t offset) return cpp::fail(Error::kUnsupportedFormat); } - auto data_offset = offset * samples_per_second * bits_per_sample; + int64_t data_offset = offset * samples_per_second * bytes_per_sample_; // Seek track to start of data input->SeekTo(data_chunk_index + 8 + data_offset, IStream::SeekFrom::kStartOfStream); @@ -218,6 +218,7 @@ auto WavDecoder::DecodeTo(cpp::span<sample::Sample> output) buffer_.ConsumeBytes([&](cpp::span<std::byte> buf) -> size_t { size_t bytes_read = buf.size_bytes(); + ESP_LOGI(kTag, "Bytes read: %d", bytes_read); size_t frames_read = bytes_read / bytes_per_sample_ / output_format_.num_channels; @@ -243,6 +244,11 @@ auto WavDecoder::DecodeTo(cpp::span<sample::Sample> output) return samples_written * bytes_per_sample_; }); + ESP_LOGI(kTag, "Samples written %d", samples_written); + if (is_eof) { + ESP_LOGI(kTag, "EOF"); + } + return OutputInfo{.samples_written = samples_written, .is_stream_finished = samples_written == 0 && is_eof}; } |
