pub fn supported_output_configs(
        &self,
    ) -> Result<SupportedOutputConfigs, SupportedStreamConfigsError> {
        // Retrieve the default config for the total supported channels and supported sample
        // format.
        let mut f = match self.default_output_config() {
            Err(_) => return Err(SupportedStreamConfigsError::DeviceNotAvailable),
            Ok(f) => f,
        };

        // Collect a config for every combination of supported sample rate and number of channels.
        let mut supported_configs = vec![];
        for &rate in ::COMMON_SAMPLE_RATES {
            if !self
                .driver
                .can_sample_rate(rate.0.into())
                .ok()
                .unwrap_or(false)
            {
                continue;
            }
            for channels in 1..f.channels + 1 {
                supported_configs.push(SupportedStreamConfigRange {
                    channels,
                    min_sample_rate: rate,
                    max_sample_rate: rate,
                    buffer_size: f.buffer_size.clone(),
                    sample_format: f.sample_format.clone(),
                })
            }
        }
        Ok(supported_configs.into_iter())
    }
/// Gets the supported output configs.
/// TODO currently only supports the default.
/// Need to find all possible configs.
Gets the supported output configs.
TODO currently only supports the default.
Need to find all possible configs.
Gets the supported output configs . TODO currently only supports the default . Need to find all possible configs .
pub fn supported_output_configs(
        &self,
    ) -> Result<SupportedOutputConfigs, SupportedStreamConfigsError> {
        // Retrieve the default config for the total supported channels and supported sample
        // format.
        let mut f = match self.default_output_config() {
            Err(_) => return Err(SupportedStreamConfigsError::DeviceNotAvailable),
            Ok(f) => f,
        };
        // Collect a config for every combination of supported sample rate and number of channels.
        let mut supported_configs = vec![];
        for &rate in ::COMMON_SAMPLE_RATES {
            if !self
                .driver
                .can_sample_rate(rate.0.into())
                .ok()
                .unwrap_or(false)
            {
                continue;
            }
            for channels in 1..f.channels + 1 {
                supported_configs.push(SupportedStreamConfigRange {
                    channels,
                    min_sample_rate: rate,
                    max_sample_rate: rate,
                    buffer_size: f.buffer_size.clone(),
                    sample_format: f.sample_format.clone(),
                })
            }
        }
        Ok(supported_configs.into_iter())
    }
pub fn supported_output_configs ( & self , ) -> Result < SupportedOutputConfigs , SupportedStreamConfigsError > { // Retrieve the default config for the total supported channels and supported sample // format. let mut f = match self . default_output_config ( ) { Err ( _ ) => return Err ( SupportedStreamConfigsError :: DeviceNotAvailable ) , Ok ( f ) => f , } ; // Collect a config for every combination of supported sample rate and number of channels. let mut supported_configs = vec ! [ ] ; for & rate in :: COMMON_SAMPLE_RATES { if ! self . driver . can_sample_rate ( rate . 0 . into ( ) ) . ok ( ) . unwrap_or ( false ) { continue ; } for channels in 1 .. f . channels + 1 { supported_configs . push ( SupportedStreamConfigRange { channels , min_sample_rate : rate , max_sample_rate : rate , buffer_size : f . buffer_size . clone ( ) , sample_format : f . sample_format . clone ( ) , } ) } } Ok ( supported_configs . into_iter ( ) ) }
Gets the supported output configs.
Gets the supported output configs .
&self
&self