Microphone capture device and session helpers.
Dependencies
///|
fn main {
let devices = @microphone.MicrophoneDevice::list()
for device in devices {
println(device.session_label())
}
}///|
fn example_label {
let device = @microphone.MicrophoneDevice::{
id: "mic-1",
name: "Built-in Mic",
state: Idle,
default_config: @microphone.CaptureConfig::new(
echo_cancellation=true,
noise_suppression=true,
),
monitor_supported: true,
}
println(device.session_label())
}pub(all) struct CaptureConfig {
channels : Int
sample_rate_hz : Int
sample_format : SampleFormat
echo_cancellation : Bool
noise_suppression : Bool
} derive(Eq, Debug)impl Show for CaptureConfigfn CaptureConfig::new(channels? : Int, sample_rate_hz? : Int, sample_format? : SampleFormat, echo_cancellation? : Bool, noise_suppression? : Bool) -> CaptureConfigimpl Show for CaptureStatepub(all) struct MicrophoneDevice {
id : String
name : String
state : CaptureState
default_config : CaptureConfig
monitor_supported : Bool
} derive(Eq, Debug)impl Show for MicrophoneDeviceimpl Show for SampleFormatMicrophone capture device and session helpers.
Dependencies