pub struct DummyPlayer { /* private fields */ }Expand description
A no-op audio player that discards all samples.
Useful for testing, benchmarking, or running on systems without an audio output device.
Implementations§
Source§impl DummyPlayer
impl DummyPlayer
Sourcepub fn total_samples(&self) -> usize
pub fn total_samples(&self) -> usize
Total number of samples received.
Sourcepub fn chunk_count(&self) -> usize
pub fn chunk_count(&self) -> usize
Number of chunks received.
Sourcepub fn last_sample_rate(&self) -> u32
pub fn last_sample_rate(&self) -> u32
Last sample rate seen (0 if no chunks received).
Sourcepub fn is_finalized(&self) -> bool
pub fn is_finalized(&self) -> bool
Whether finalize has been called.
Trait Implementations§
Source§impl AudioSink for DummyPlayer
impl AudioSink for DummyPlayer
Source§fn write_chunk(
&mut self,
samples: &[i16],
sample_rate: u32,
) -> Result<(), PiperError>
fn write_chunk( &mut self, samples: &[i16], sample_rate: u32, ) -> Result<(), PiperError>
Called for each audio chunk produced by the synthesizer.
Auto Trait Implementations§
impl Freeze for DummyPlayer
impl RefUnwindSafe for DummyPlayer
impl Send for DummyPlayer
impl Sync for DummyPlayer
impl Unpin for DummyPlayer
impl UnsafeUnpin for DummyPlayer
impl UnwindSafe for DummyPlayer
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