pub struct SupportedStreamConfigRange { /* private fields */ }
Expand description

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

Implementations

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.

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.