pub struct Consumer { /* private fields */ }Expand description
Subscribe to a moq-mux audio track and emit decoded PCM in the layout
declared by Config.
The mirror of encode::Producer: output format /
sample rate / channel count are fixed at construction, and
read returns plain Frames.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub async fn new(
broadcast: &Consumer,
catalog: &AudioConfig,
name: impl Into<String>,
config: Config,
) -> Result<Self, Error>
pub async fn new( broadcast: &Consumer, catalog: &AudioConfig, name: impl Into<String>, config: Config, ) -> Result<Self, Error>
Subscribe to name in broadcast, using the catalog entry to pick the
codec.
Sourcepub fn sample_rate(&self) -> u32
pub fn sample_rate(&self) -> u32
Sample rate samples are actually delivered at, which is
Config::sample_rate resolved against the catalog.
Sourcepub fn channels(&self) -> u32
pub fn channels(&self) -> u32
Channel count samples are actually delivered at, which is
Config::channels resolved against the catalog.
Auto Trait Implementations§
impl !RefUnwindSafe for Consumer
impl !Sync for Consumer
impl !UnwindSafe for Consumer
impl Freeze for Consumer
impl Send for Consumer
impl Unpin for Consumer
impl UnsafeUnpin for Consumer
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