#pragma once #include "./frame_stream2.hpp" #include #include #include #include // raw audio // channels make samples interleaved, // planar channels are not supported // s16 only stopgap audio frame (simplified) struct AudioFrame2 { // samples per second uint32_t sample_rate {48'000}; // only >0 is valid size_t channels {0}; std::variant< std::vector, // S16, platform endianess Span // non owning variant, for direct consumption > buffer; // helpers Span getSpan(void) const { if (std::holds_alternative>(buffer)) { return Span{std::get>(buffer)}; } else { return std::get>(buffer); } return {}; } }; using AudioFrame2Stream2I = FrameStream2I;