summaryrefslogtreecommitdiff
path: root/src/codecs/include/opus.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-08-08 22:16:31 +1000
committerjacqueline <me@jacqueline.id.au>2023-08-08 22:16:31 +1000
commit6c3501dbcbd1095293d8a4d4b83311e94a7df9a8 (patch)
tree25bfee94dd427a2110cab3e0ac1da6b5d05dadf2 /src/codecs/include/opus.hpp
parente1181fbe59a835ea9c93d6e067e9757e8c522d3c (diff)
downloadtangara-fw-6c3501dbcbd1095293d8a4d4b83311e94a7df9a8.tar.gz
Flesh out opus decoder. it doesn't work! i hate opus.
Diffstat (limited to 'src/codecs/include/opus.hpp')
-rw-r--r--src/codecs/include/opus.hpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/codecs/include/opus.hpp b/src/codecs/include/opus.hpp
index a5a7d78c..f824a7cb 100644
--- a/src/codecs/include/opus.hpp
+++ b/src/codecs/include/opus.hpp
@@ -14,6 +14,7 @@
#include <utility>
#include "opus.h"
+#include "sample.hpp"
#include "span.hpp"
#include "codec.hpp"
@@ -36,14 +37,18 @@ class XiphOpusDecoder : public ICodec {
* Writes samples for the current frame.
*/
auto ContinueStream(cpp::span<const std::byte> input,
- cpp::span<std::byte> output)
+ cpp::span<sample::Sample> output)
-> Result<OutputInfo> override;
auto SeekStream(cpp::span<const std::byte> input, std::size_t target_sample)
-> Result<void> override;
private:
- OpusDecoder *opus_;
- float *sample_buffer_;
- std::size_t sample_buffer_len_;
+ OpusDecoder* opus_;
+ cpp::span<int16_t> sample_buffer_;
+ int32_t pos_in_buffer_;
+ int32_t samples_in_buffer_;
+
+};
+
} // namespace codecs