Skip to main content

Module device

Module device 

Source
Expand description

The inputs a host can record from, and the plan one opens at.

Re-exportsΒ§

use cpal::traits::DeviceTrait; πŸ”’
use cpal::traits::HostTrait; πŸ”’
use crate::Error; πŸ”’
use crate::SAMPLE_RATE; πŸ”’

StructsΒ§

Candidate πŸ”’
One openable offer, scored the way the negotiation chooses between them.
Device
An input the host can offer a user, and record from.
InputPlan πŸ”’
How a capture opens: the stream config the device will run at, the format its stream delivers, and the rate its samples arrive at when that is not already SAMPLE_RATE.

EnumsΒ§

InputFormat πŸ”’
The sample formats the capture can open. Anything else is refused at the plan rather than when the stream is built.

FunctionsΒ§

describe πŸ”’
The host’s own record of a device already resolved: its id, its label, and whether the system would have picked it unaided.
devices
Every input the host could record from.
input_config πŸ”’
Pick an input the models can read.
input_plan πŸ”’
The negotiation over synthetic ranges, so a device is not needed to test it.
open_device πŸ”’
Resolve a caller’s choice to a cpal device.
record πŸ”’
One device as the host describes it: the id a host persists, the label a picker shows, and whether the system would pick it unaided.