Result<T, E> — either holds a T or an E, never both.
Definition result.hpp:76
Definition archive.hpp:24
std::vector< std::uint8_t > to_canonical_bytes(const CanonicalPcm &pcm)
Serialize to the exact member bytes a capsule stores: the fixed header documented at the top of this ...
constexpr std::uint32_t kMinCanonicalSampleRate
Definition canonical_pcm.hpp:43
constexpr std::uint32_t kMaxCanonicalChannels
Definition canonical_pcm.hpp:45
constexpr std::uint32_t kMaxCanonicalSampleRate
Definition canonical_pcm.hpp:44
runtime::Result< void, CapsuleError > validate_canonical(const CanonicalPcm &pcm)
Reject NaN, infinity, and any frame count that disagrees with the buffer length.
constexpr std::uint32_t kCanonicalPcmDecoderVersion
The decoder's contract version, stored in every canonical member's header.
Definition canonical_pcm.hpp:51
constexpr char kCanonicalPcmMagic[8]
First eight bytes of every canonical member.
Definition canonical_pcm.hpp:54
constexpr std::size_t kCanonicalPcmHeaderBytes
Fixed header size; sample data begins here.
Definition canonical_pcm.hpp:57
runtime::Result< CanonicalPcm, CapsuleError > decode_to_canonical(std::span< const std::uint8_t > source)
Decode a source audio file into the canonical form.
std::string canonical_pcm_digest(const CanonicalPcm &pcm)
SHA-256, bare lowercase hex, over to_canonical_bytes(pcm).
runtime::Result< CanonicalPcm, CapsuleError > from_canonical_bytes(std::span< const std::uint8_t > bytes)
Parse a canonical member from its bytes alone; no external metadata exists.
Result<T, E> — success / failure union for fallible operations.
Admission failure vocabulary for authoring capsules.
Definition canonical_pcm.hpp:59
std::uint64_t frame_count
Definition canonical_pcm.hpp:62
std::uint32_t channels
Definition canonical_pcm.hpp:60
std::uint32_t sample_rate
Definition canonical_pcm.hpp:61
std::vector< float > samples
Interleaved, frame_count * channels samples.
Definition canonical_pcm.hpp:64