Struct ExactPcmSession

Source
pub struct ExactPcmSession { /* private fields */ }
Expand description

A fixed-format source session with no modifying processing stages.

This is a software building block, separate from super::session::PcmSession. It owns no decoder, transport, sound device or listening records. The existing driver remains responsible for selection, cancellation/seeking, queue writes and history after accepted output. There are no gain, tone, rate conversion, downmix, guard, limiter or dither controls to silently apply or ignore here.

Call end_track only after successful decoder EOF, including a present FLAC MD5 verification. Each occurrence completes once, without delayed frames or flushing silence. Invalid blocks/lifecycle requests leave state unchanged. A transport interruption or output failure requires discarding this session and queued audio. Neither its output metadata nor produced completion markers establish device eligibility, audible completion or physical bit identity.

Implementations§

Source§

impl ExactPcmSession

Source

pub fn new( input: IntegerPcmFormat, output: ExactOutputFormat, ) -> Result<Self, ExactSessionError>

Validate fixed source/output representation outside the audio callback.

Source

pub fn input_format(&self) -> IntegerPcmFormat

Original precision, rate and channel association.

Source

pub fn output_format(&self) -> ExactOutputFormat

Exact representation metadata, distinct from device-route evidence.

Source

pub fn source_frames(&self) -> u64

Cumulative accepted source frames, with no converted or delayed frames.

Source

pub fn compatible( &self, input: IntegerPcmFormat, output: ExactOutputFormat, ) -> bool

Whether a natural next occurrence can share this fixed-format session.

Source

pub fn begin_track(&mut self, token: usize) -> Result<(), ExactSessionError>

Start a driver-identified occurrence without selecting any processing.

Source

pub fn push_source( &mut self, samples: &[i32], ) -> Result<ExactSessionBlock<'_>, ExactSessionError>

Preserve one bounded block of complete source frames and encode exactly.

The adapter checks source-depth range, frame alignment and block bounds before replacing any output. Observational peaks use an independent normalized value; canonical source integers are never altered.

Source

pub fn end_track(&mut self) -> Result<ExactSessionBlock<'_>, ExactSessionError>

Seal one successfully decoded source, with no tail or extra samples.

Source

pub fn finish(&mut self) -> Result<ExactSessionBlock<'_>, ExactSessionError>

Finish the sealed group; repeated calls emit no duplicate completion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,