streaming_decoder¶
| Type | Class |
| Namespace | conjure::audio |
| Include File Path | engine/include/conjure/audio/decoder.h |
| Source File Path | N/A |
| API ↗ | Clips and decoding |
Syntax¶
Constructors¶
| Access | Signature | Description |
|---|---|---|
| public | streaming_decoder(); | |
| public | streaming_decoder(
streaming_decoder &&) noexcept; |
Important
Copy constructor and assignment has been deleted.
Destructors¶
| Access | Signature | Description |
|---|---|---|
| public | ~streaming_decoder(); |
Variables¶
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mInfo | clip_info | {} | |
| private | mPosition | u64 | 0 | |
| private | mState | std::unique_ptr<state> | {} |
Functions¶
Public¶
info¶
info¶[[nodiscard]] const clip_info &info() const noexcept;Format, length and encoding of the open stream (storage STREAMED).
open¶
open¶[[nodiscard]] core::result<void> open(
std::span<const byte> encoded);Opens a decoder over caller-owned bytes, which must outlive the decoder (or close()). An open decoder is closed first. A container that does not report its length (Ogg Vorbis) is decoded once to count it, which costs a full decode on the calling thread; use the overload below when the length is already known. Same errors as probe().
[[nodiscard]] core::result<void> open(
std::span<const byte> encoded,
u64 knownFrameCount);open() with a length the caller already knows (a probed clip's info.frameCount): the container's own length wins when it reports one, otherwise knownFrameCount is used and nothing is decoded before the first read(). 0 counts as unknown.
read¶
read¶Decodes up to out.size() / channels frames into interleaved f32; returns the number of frames written (0 at the end of the stream or when closed).
seek¶
seek¶[[nodiscard]] core::result<void> seek(
u64 frame) noexcept;Positions the next read at frame. INVALID_STATE when closed, DECODE_FAILED when the decoder refuses the position.
Operator Overloads¶
Public¶
operator=¶
operator=¶streaming_decoder &operator=(
streaming_decoder &&) noexcept;