Struct cpal::SupportedFormat
[−]
[src]
pub struct SupportedFormat { pub channels: ChannelCount, pub min_sample_rate: SampleRate, pub max_sample_rate: SampleRate, pub data_type: SampleFormat, }
Describes a range of supported stream formats.
Fields
channels: ChannelCount
min_sample_rate: SampleRate
Minimum value for the samples rate of the supported formats.
max_sample_rate: SampleRate
Maximum value for the samples rate of the supported formats.
data_type: SampleFormat
Type of data expected by the device.
Methods
impl SupportedFormat
[src]
pub fn with_max_sample_rate(self) -> Format
[src]
Turns this SupportedFormat
into a Format
corresponding to the maximum samples rate.
pub fn cmp_default_heuristics(&self, other: &Self) -> Ordering
[src]
A comparison function which compares two SupportedFormat
s in terms of their priority of
use as a default stream format.
Some backends do not provide a default stream format for their audio devices. In these cases, CPAL attempts to decide on a reasonable default format for the user. To do this we use the "greatest" of all supported stream formats when compared with this method.
Formats are prioritised by the following heuristics:
Channels:
- Stereo
- Mono
- Max available channels
Sample format:
- f32
- i16
- u16
Sample rate:
- 44100 (cd quality)
- Max sample rate
Trait Implementations
impl Debug for SupportedFormat
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for SupportedFormat
[src]
fn clone(&self) -> SupportedFormat
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for SupportedFormat
[src]
fn eq(&self, __arg_0: &SupportedFormat) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SupportedFormat) -> bool
[src]
This method tests for !=
.
impl Eq for SupportedFormat
[src]
impl From<Format> for SupportedFormat
[src]
fn from(format: Format) -> SupportedFormat
[src]
Performs the conversion.