[][src]Trait cpal::traits::DeviceTrait

A device that is capable of audio input and/or output.

Please note that Devices may become invalid if they get disconnected. Therefore all the methods that involve a device return a Result allowing the user to handle this case.

Associated Types

type SupportedInputFormats: Iterator<Item = SupportedFormat>

The iterator type yielding supported input stream formats.

type SupportedOutputFormats: Iterator<Item = SupportedFormat>

The iterator type yielding supported output stream formats.

Loading content...

Required methods

fn name(&self) -> Result<String, DeviceNameError>

The human-readable name of the device.

fn supported_input_formats(
    &self
) -> Result<Self::SupportedInputFormats, SupportedFormatsError>

An iterator yielding formats that are supported by the backend.

Can return an error if the device is no longer valid (eg. it has been disconnected).

fn supported_output_formats(
    &self
) -> Result<Self::SupportedOutputFormats, SupportedFormatsError>

An iterator yielding output stream formats that are supported by the device.

Can return an error if the device is no longer valid (eg. it has been disconnected).

fn default_input_format(&self) -> Result<Format, DefaultFormatError>

The default input stream format for the device.

fn default_output_format(&self) -> Result<Format, DefaultFormatError>

The default output stream format for the device.

Loading content...

Implementors

Loading content...