pub struct AudioReader<D> { /* private fields */ }Expand description
Audio of one source at one rate, over a Decoder delivering that rate.
Implementations§
Source§impl<D: Decoder> AudioReader<D>
impl<D: Decoder> AudioReader<D>
Sourcepub const fn new(
decoder: D,
source: SourceId,
rate: u32,
cancel: CancelToken,
) -> Self
pub const fn new( decoder: D, source: SourceId, rate: u32, cancel: CancelToken, ) -> Self
A reader of source from decoder, which delivers rate samples a second.
Sourcepub fn block(
&mut self,
start_sample: i64,
frames: u32,
channels: AudioChannels,
) -> Result<SuppliedAudio, DecodeError>
pub fn block( &mut self, start_sample: i64, frames: u32, channels: AudioChannels, ) -> Result<SuppliedAudio, DecodeError>
Exactly frames frames from start_sample, in channels, silence outside the stream.
§Errors
The decoder’s failure or cancellation.
Auto Trait Implementations§
impl<D> Forget for AudioReader<D>
impl<D> Freeze for AudioReader<D>where
D: Freeze,
impl<D> Move for AudioReader<D>
impl<D> RefUnwindSafe for AudioReader<D>where
D: RefUnwindSafe,
impl<D> Send for AudioReader<D>where
D: Send,
impl<D> Sync for AudioReader<D>where
D: Sync,
impl<D> Unpin for AudioReader<D>where
D: Unpin,
impl<D> UnsafeUnpin for AudioReader<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for AudioReader<D>where
D: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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