pub struct AudioConsumer { /* private fields */ }Expand description
Subscribe to a moq-mux audio track and emit decoded PCM in the
format declared by DecoderOutput.
Output format / sample rate / channel count are fixed at
construction; read returns plain Frames.
Implementations§
Source§impl AudioConsumer
impl AudioConsumer
Sourcepub fn new(
broadcast: &BroadcastConsumer,
catalog: &AudioConfig,
name: impl Into<String>,
output: DecoderOutput,
) -> Result<Self, AudioError>
pub fn new( broadcast: &BroadcastConsumer, catalog: &AudioConfig, name: impl Into<String>, output: DecoderOutput, ) -> Result<Self, AudioError>
Subscribe to name in broadcast using the catalog entry to
pick the codec.
pub fn output(&self) -> &DecoderOutput
Sourcepub fn sample_rate(&self) -> u32
pub fn sample_rate(&self) -> u32
Sample rate samples are actually delivered at (= output.sample_rate
if set, otherwise the decoder’s native rate).
Auto Trait Implementations§
impl !RefUnwindSafe for AudioConsumer
impl !Sync for AudioConsumer
impl !UnwindSafe for AudioConsumer
impl Freeze for AudioConsumer
impl Send for AudioConsumer
impl Unpin for AudioConsumer
impl UnsafeUnpin for AudioConsumer
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