pub struct AudioStream { /* private fields */ }Expand description
An audio track decoded at the project rate.
Implementations§
Source§impl AudioStream
impl AudioStream
Sourcepub fn open_file(
path: &Path,
backends: &dyn AudioBackends,
project_rate: u32,
stream: Option<u32>,
policy: DecodePolicy,
) -> Result<Self, DecodeError>
pub fn open_file( path: &Path, backends: &dyn AudioBackends, project_rate: u32, stream: Option<u32>, policy: DecodePolicy, ) -> Result<Self, DecodeError>
Opens audio track stream (an ordinal over the file’s audio tracks in container order;
None is the default track) of the file at path, delivered at project_rate.
§Errors
DecodeError::Unsupported for a container this layer does not read, a missing track,
or a track no session reads; read failures.
Sourcepub fn open(
reader: Box<dyn ContainerReader>,
index: usize,
backends: &dyn AudioBackends,
project_rate: u32,
policy: DecodePolicy,
) -> Result<Self, DecodeError>
pub fn open( reader: Box<dyn ContainerReader>, index: usize, backends: &dyn AudioBackends, project_rate: u32, policy: DecodePolicy, ) -> Result<Self, DecodeError>
Opens track index of reader, delivered at project_rate.
§Errors
DecodeError::Unsupported for a track that is not audio or that no session reads;
DecodeError::OutOfRange for a zero rate.
Sourcepub const fn speakers(&self) -> SpeakerLayout
pub const fn speakers(&self) -> SpeakerLayout
The speaker order of every block.
Sourcepub fn next_block(
&mut self,
cancel: &CancelToken,
) -> Result<Option<AudioBlock>, DecodeError>
pub fn next_block( &mut self, cancel: &CancelToken, ) -> Result<Option<AudioBlock>, DecodeError>
The next block of up to 1024 samples at the project rate; None at the end.
§Errors
Cancellation, a spent work budget, or a decoder failure.
Sourcepub fn seek(
&mut self,
time: MediaTime,
cancel: &CancelToken,
) -> Result<AudioBlock, DecodeError>
pub fn seek( &mut self, time: MediaTime, cancel: &CancelToken, ) -> Result<AudioBlock, DecodeError>
The block holding time’s sample, starting at that sample, or at the stream’s first
sample for an earlier time.
§Errors
DecodeError::OutOfRange past the end; otherwise as Self::next_block.
Trait Implementations§
Source§impl Debug for AudioStream
impl Debug for AudioStream
Source§impl Decoder for AudioStream
impl Decoder for AudioStream
Source§fn streams(&self) -> &[StreamInfo]
fn streams(&self) -> &[StreamInfo]
Source§fn flush(&mut self) -> Result<(), DecodeError>
fn flush(&mut self) -> Result<(), DecodeError>
Source§fn seek(
&mut self,
request: DecodeRequest,
cancel: &CancelToken,
) -> Result<DecodeResult, DecodeError>
fn seek( &mut self, request: DecodeRequest, cancel: &CancelToken, ) -> Result<DecodeResult, DecodeError>
Source§fn decode_next(
&mut self,
cancel: &CancelToken,
) -> Result<DecodeEvent, DecodeError>
fn decode_next( &mut self, cancel: &CancelToken, ) -> Result<DecodeEvent, DecodeError>
Source§impl WindowedAudioDecoder for AudioStream
Available on crate feature engine only.A stream behind a mix’s audio windows; its blocks hold at most BLOCK_FRAMES samples.
impl WindowedAudioDecoder for AudioStream
engine only.A stream behind a mix’s audio windows; its blocks hold at most BLOCK_FRAMES samples.
Auto Trait Implementations§
impl !Freeze for AudioStream
impl !RefUnwindSafe for AudioStream
impl !Sync for AudioStream
impl !UnwindSafe for AudioStream
impl Forget for AudioStream
impl Move for AudioStream
impl Send for AudioStream
impl Unpin for AudioStream
impl UnsafeUnpin for AudioStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more