pub struct PlaybackBuffer<const N: usize> { /* private fields */ }Expand description
Caller-owned storage, including exactly N PCM bytes plus control/cursor state.
Allocate it once, or put it in static memory for an interrupt/host callback.
N must be nonzero and divisible by the configured frame size.
Implementations§
Source§impl<const N: usize> PlaybackBuffer<N>
impl<const N: usize> PlaybackBuffer<N>
pub const fn new() -> Self
Sourcepub fn split(
&mut self,
configuration: Configuration,
) -> Result<(OutputDevice<'_, N>, Renderer<'_, N>)>
pub fn split( &mut self, configuration: Configuration, ) -> Result<(OutputDevice<'_, N>, Renderer<'_, N>)>
Create a paused device and its single consumer, emptying previous data. The configuration is fixed until both halves have been dropped.
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> !Freeze for PlaybackBuffer<N>
impl<const N: usize> !RefUnwindSafe for PlaybackBuffer<N>
impl<const N: usize> Send for PlaybackBuffer<N>
impl<const N: usize> Sync for PlaybackBuffer<N>
impl<const N: usize> Unpin for PlaybackBuffer<N>
impl<const N: usize> UnsafeUnpin for PlaybackBuffer<N>
impl<const N: usize> UnwindSafe for PlaybackBuffer<N>
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