Struct cpal::SupportedStreamConfigRange[][src]

pub struct SupportedStreamConfigRange { /* fields omitted */ }

Describes a range of supported stream configurations, retrieved via the Device::supported_input/output_configs method.

Implementations

impl SupportedStreamConfigRange[src]

pub fn channels(&self) -> ChannelCount[src]

pub fn min_sample_rate(&self) -> SampleRate[src]

pub fn max_sample_rate(&self) -> SampleRate[src]

pub fn buffer_size(&self) -> &SupportedBufferSize[src]

pub fn sample_format(&self) -> SampleFormat[src]

pub fn with_sample_rate(self, sample_rate: SampleRate) -> SupportedStreamConfig[src]

Retrieve a SupportedStreamConfig with the given sample rate and buffer size.

**panic!**s if the given sample_rate is outside the range specified within this SupportedStreamConfigRange instance.

pub fn with_max_sample_rate(self) -> SupportedStreamConfig[src]

Turns this SupportedStreamConfigRange into a SupportedStreamConfig corresponding to the maximum samples rate.

pub fn cmp_default_heuristics(&self, other: &Self) -> Ordering[src]

A comparison function which compares two SupportedStreamConfigRanges 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.

SupportedStreamConfigs 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 Clone for SupportedStreamConfigRange[src]

impl Debug for SupportedStreamConfigRange[src]

impl Eq for SupportedStreamConfigRange[src]

impl PartialEq<SupportedStreamConfigRange> for SupportedStreamConfigRange[src]

impl StructuralEq for SupportedStreamConfigRange[src]

impl StructuralPartialEq for SupportedStreamConfigRange[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.