Struct ao::auto::AutoFormatDevice [-]  [+] [src]

pub struct AutoFormatDevice<'a, S> {
    // some fields omitted
}

Automatically adjusts the output format according to incoming buffers.

This device adapter can automatically manage the underlying Device to ensure it always has the correct sample format, so the format of incoming samples may change at runtime.

Methods

impl<'a, S: Str> AutoFormatDevice<'a, S>

fn new(driver: Driver<'a>, matrixes: Vec<S>) -> AutoFormatDevice<'a, S>

Construct a new AutoFormatDevice.

Will be backed by the specified driver, and the matrixes is a list where an element's index maps to the number of channels. See Sampleformat.matrix for the format of each channel matrix.

fn play(&mut self, data: &SampleBuffer) -> AoResult<()>

Play samples from a dynamic format buffer.

The underling device may be reopened, and returns Err if the format of the buffer is not supported.