pub trait BufferCommit {
    // Required method
    fn commit(&mut self, nframes: usize);

    // Provided method
    fn latency_bytes(&self) -> u32 { ... }
}
Expand description

BufferCommit is a cleanup funcion that must be called before dropping the buffer, allowing arbitrary code to be run after the buffer is filled or read by the user.

Required Methods§

source

fn commit(&mut self, nframes: usize)

write_playback_buffer or read_capture_buffer would trigger this automatically. nframes indicates the number of audio frames that were read or written to the device.

Provided Methods§

source

fn latency_bytes(&self) -> u32

latency_bytes the current device latency. For playback it means how many bytes need to be consumed before the current playback buffer will be played. For capture it means the latency in terms of bytes that the capture buffer was recorded.

Implementors§