pub struct BorrowedAudioFrameBuilder<'buf> { /* private fields */ }Expand description
Builder for BorrowedAudioFrame; no sample or metadata copies are made.
Implementations§
Source§impl<'buf> BorrowedAudioFrameBuilder<'buf>
impl<'buf> BorrowedAudioFrameBuilder<'buf>
Sourcepub fn channel_stride_bytes(self, bytes: usize) -> Self
pub fn channel_stride_bytes(self, bytes: usize) -> Self
Set the distance in bytes between consecutive channel starts.
Must be a positive multiple of size_of::<f32>(), at least one channel’s
samples, and fit the SDK’s signed 32-bit stride field.
Sourcepub fn clear_channel_stride_bytes(self) -> Self
pub fn clear_channel_stride_bytes(self) -> Self
Reset the stride override to tightly packed channels.
Sourcepub fn timecode(self, timecode: Timecode) -> Self
pub fn timecode(self, timecode: Timecode) -> Self
Set the frame timecode; defaults to Timecode::SYNTHESIZE.
Sourcepub fn metadata(self, metadata: &'buf CStr) -> Self
pub fn metadata(self, metadata: &'buf CStr) -> Self
Borrow NUL-terminated UTF-8 metadata, validated when built. An explicit empty C string differs from absent metadata.
Sourcepub fn clear_metadata(self) -> Self
pub fn clear_metadata(self) -> Self
Remove the optional metadata override.
Sourcepub fn build(self) -> Result<BorrowedAudioFrame<'buf>>
pub fn build(self) -> Result<BorrowedAudioFrame<'buf>>
Validate the rate, positive channel/sample counts, stride, sample extent and optional UTF-8 metadata without allocating sample storage.
§Errors
Error::InvalidFrame for an invalid layout, insufficient storage,
exceeding the 64 MiB audio limit or the 4 MiB metadata cap;
Error::InvalidUtf8 for metadata that is not UTF-8.