diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-08-08 20:25:42 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-08-08 20:25:42 +1000 |
| commit | e1181fbe59a835ea9c93d6e067e9757e8c522d3c (patch) | |
| tree | 2fd61bb93713de8c2205b7b6d0a8c84c49832e93 /src/codecs/foxenflac.cpp | |
| parent | c3f40a8cc37114365ef3ec6f2888df64e5206b39 (diff) | |
| parent | 592f231627843bc44ebaaa4506aec26da1f56499 (diff) | |
| download | tangara-fw-e1181fbe59a835ea9c93d6e067e9757e8c522d3c.tar.gz | |
Merge branch 'main' into opus
Diffstat (limited to 'src/codecs/foxenflac.cpp')
| -rw-r--r-- | src/codecs/foxenflac.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codecs/foxenflac.cpp b/src/codecs/foxenflac.cpp index 3a727ce2..b676f82a 100644 --- a/src/codecs/foxenflac.cpp +++ b/src/codecs/foxenflac.cpp @@ -12,6 +12,7 @@ #include "esp_log.h" #include "foxen/flac.h" +#include "sample.hpp" namespace codecs { @@ -47,7 +48,6 @@ auto FoxenFlacDecoder::BeginStream(const cpp::span<const std::byte> input) OutputFormat format{ .num_channels = static_cast<uint8_t>(channels), - .bits_per_sample = 32, // libfoxenflac output is fixed-size. .sample_rate_hz = static_cast<uint32_t>(fs), .duration_seconds = {}, .bits_per_second = {}, @@ -62,7 +62,7 @@ auto FoxenFlacDecoder::BeginStream(const cpp::span<const std::byte> input) } auto FoxenFlacDecoder::ContinueStream(cpp::span<const std::byte> input, - cpp::span<std::byte> output) + cpp::span<sample::Sample> output) -> Result<OutputInfo> { cpp::span<int32_t> output_as_samples{ reinterpret_cast<int32_t*>(output.data()), output.size_bytes() / 4}; @@ -78,7 +78,7 @@ auto FoxenFlacDecoder::ContinueStream(cpp::span<const std::byte> input, if (samples_written > 0) { return {bytes_read, - OutputInfo{.bytes_written = samples_written * 4, + OutputInfo{.samples_written = samples_written, .is_finished_writing = state == FLAC_END_OF_FRAME}}; } |
