[−][src]Struct cpal::SupportedFormat
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 Eq for SupportedFormat
[src]
impl Clone for SupportedFormat
[src]
fn clone(&self) -> SupportedFormat
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<SupportedFormat> for SupportedFormat
[src]
fn eq(&self, other: &SupportedFormat) -> bool
[src]
fn ne(&self, other: &SupportedFormat) -> bool
[src]
impl From<Format> for SupportedFormat
[src]
fn from(format: Format) -> SupportedFormat
[src]
impl Debug for SupportedFormat
[src]
Auto Trait Implementations
impl Unpin for SupportedFormat
impl Sync for SupportedFormat
impl Send for SupportedFormat
impl UnwindSafe for SupportedFormat
impl RefUnwindSafe for SupportedFormat
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,