Struct cpal::SupportedStreamConfigRange [−][src]
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 SupportedStreamConfigRange
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.
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]
fn clone(&self) -> SupportedStreamConfigRange
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SupportedStreamConfigRange
[src]
impl Eq for SupportedStreamConfigRange
[src]
impl PartialEq<SupportedStreamConfigRange> for SupportedStreamConfigRange
[src]
fn eq(&self, other: &SupportedStreamConfigRange) -> bool
[src]
fn ne(&self, other: &SupportedStreamConfigRange) -> bool
[src]
impl StructuralEq for SupportedStreamConfigRange
[src]
impl StructuralPartialEq for SupportedStreamConfigRange
[src]
Auto Trait Implementations
impl RefUnwindSafe for SupportedStreamConfigRange
impl Send for SupportedStreamConfigRange
impl Sync for SupportedStreamConfigRange
impl Unpin for SupportedStreamConfigRange
impl UnwindSafe for SupportedStreamConfigRange
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,