pub struct WaveformPlayer { /* private fields */ }Expand description
Plays one Waveform into a sink’s buffers: mono and stereo to any sink with a channel mapping, no resampling. Create it with the
sink’s config, keep the PlayerControl, and hand WaveformPlayer::into_render to AudioSink::start.
It starts paused.
Implementations§
Source§impl WaveformPlayer
impl WaveformPlayer
pub fn new( waveform: Waveform, config: &SinkConfig, ) -> Result<(WaveformPlayer, PlayerControl), PlayerError>
Sourcepub fn render(&mut self, out: &mut [f32])
pub fn render(&mut self, out: &mut [f32])
Fills out (interleaved, a whole number of output frames; any trailing partial frame is silenced). Allocation-free and lock-free.
Sourcepub fn into_render(self) -> RenderFn
pub fn into_render(self) -> RenderFn
The render function for AudioSink::start.
Auto Trait Implementations§
impl Forget for WaveformPlayer
impl Freeze for WaveformPlayerwhere
*const ArcInner<[f32]> is !null: Freeze,
PhantomData<ArcInner<[f32]>>: Freeze,
*const ArcInner<Shared> is !null: Freeze,
PhantomData<ArcInner<Shared>>: Freeze,
impl Move for WaveformPlayer
impl RefUnwindSafe for WaveformPlayerwhere
Atomic<usize>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Atomic<u32>: RefUnwindSafe,
Atomic<u64>: RefUnwindSafe,
impl Send for WaveformPlayer
impl Sync for WaveformPlayer
impl Unpin for WaveformPlayer
impl UnsafeUnpin for WaveformPlayerwhere
*const ArcInner<[f32]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[f32]>>: UnsafeUnpin,
*const ArcInner<Shared> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared>>: UnsafeUnpin,
impl UnwindSafe for WaveformPlayer
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