pub struct FrameSyncAudioRequest { /* private fields */ }Expand description
A validated, reusable audio operation for FrameSync::capture_audio.
capture and capture_with require
explicit positive output channels and samples per channel. Construction checks
the SDK’s signed byte stride and the 64 MiB packed sample payload limit before
any native work. This bounds requested samples, not SDK internal memory use.
Successful construction and request reuse allocate nothing in the wrapper;
submitting a request performs no dimension checks, locks, or extra SDK queries.
Returned descriptors and metadata are still validated after each capture.
query_input queries the current input format without
requesting samples. To follow source channels, query first, wait for a positive
channel count, then build a capture request with that concrete count. Re-query
and rebuild when the application chooses to follow format changes. The SDK
converts to the explicit output count even if the source changes meanwhile.
Implementations§
Source§impl FrameSyncAudioRequest
impl FrameSyncAudioRequest
Sourcepub const fn query_input() -> Self
pub const fn query_input() -> Self
Query the current incoming audio format without requesting sample data. The result has zero sample rate and channels if no input format is known.
Sourcepub fn capture(channels: i32, samples: i32) -> Result<Self>
pub fn capture(channels: i32, samples: i32) -> Result<Self>
Capture samples using the source sample rate and explicit output channels.
§Errors
Returns Error::InvalidFrame for nonpositive dimensions, an
unrepresentable signed byte stride, arithmetic overflow, or a sample
payload exceeding 64 MiB. Validation does not allocate sample storage.
Sourcepub fn capture_with(
sample_rate: Option<i32>,
channels: i32,
samples: i32,
) -> Result<Self>
pub fn capture_with( sample_rate: Option<i32>, channels: i32, samples: i32, ) -> Result<Self>
Capture samples with an optional source-derived sample rate.
None uses the current source rate. Some(rate) must be positive.
Channels and samples per channel must always be explicitly positive.
A request can be copied and reused across borrowed and owned captures.
§Errors
Returns Error::InvalidFrame for a nonpositive explicit sample rate or
invalid dimensions as described in capture.
Trait Implementations§
Source§impl Clone for FrameSyncAudioRequest
impl Clone for FrameSyncAudioRequest
Source§fn clone(&self) -> FrameSyncAudioRequest
fn clone(&self) -> FrameSyncAudioRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more