Struct cpal::Data [−][src]
pub struct Data { /* fields omitted */ }
Expand description
A buffer of dynamically typed audio data, passed to raw stream callbacks.
Raw input stream callbacks receive &Data
, while raw output stream callbacks expect &mut Data
.
Implementations
The sample format of the internal audio data.
The full length of the buffer in samples.
The returned length is the same length as the slice of type T
that would be returned via
as_slice
given a sample type that matches the inner sample format.
The raw slice of memory representing the underlying audio data as a slice of bytes.
It is up to the user to interpret the slice of memory based on Data::sample_format
.
The raw slice of memory representing the underlying audio data as a slice of bytes.
It is up to the user to interpret the slice of memory based on Data::sample_format
.
Access the data as a slice of sample type T
.
Returns None
if the sample type does not match the expected sample format.
Access the data as a slice of sample type T
.
Returns None
if the sample type does not match the expected sample format.