diff --git a/examples/microphone.rs b/examples/microphone.rs index dee5b9b5..9666b398 100644 --- a/examples/microphone.rs +++ b/examples/microphone.rs @@ -18,24 +18,21 @@ use web_audio_api::node::AudioNode; fn ask_source_id() -> Option { println!("Enter the input 'device_id' and press "); - println!("- Use 0 for the default audio input device"); + println!("- Leave empty ('') for the default audio input device"); let input = std::io::stdin().lines().next().unwrap().unwrap(); match input.trim() { - "0" => None, + "" => None, i => Some(i.to_string()), } } fn ask_sink_id() -> String { - println!("Enter the output 'sink' and press "); - println!("- Use 0 for the default audio output device"); + println!("Enter the output 'device_id' and press "); + println!("- type 'none' to disable the output"); + println!("- Leave empty ('') for the default audio output device"); - let input = std::io::stdin().lines().next().unwrap().unwrap(); - match input.trim() { - "0" => "".to_string(), - i => i.to_string(), - } + std::io::stdin().lines().next().unwrap().unwrap() } fn main() { diff --git a/examples/roundtrip_latency_test.rs b/examples/roundtrip_latency_test.rs index 65c153f2..d80f0a19 100644 --- a/examples/roundtrip_latency_test.rs +++ b/examples/roundtrip_latency_test.rs @@ -32,24 +32,21 @@ use std::sync::Arc; fn ask_source_id() -> Option { println!("Enter the input 'device_id' and press "); - println!("- Use 0 for the default audio input device"); + println!("- Leave empty ('') for the default audio input device"); let input = std::io::stdin().lines().next().unwrap().unwrap(); match input.trim() { - "0" => None, + "" => None, i => Some(i.to_string()), } } fn ask_sink_id() -> String { - println!("Enter the output 'sink' and press "); - println!("- Use 0 for the default audio output device"); + println!("Enter the output 'device_id' and press "); + println!("- type 'none' to disable the output"); + println!("- Leave empty ('') for the default audio output device"); - let input = std::io::stdin().lines().next().unwrap().unwrap(); - match input.trim() { - "0" => "none".to_string(), - i => i.to_string(), - } + std::io::stdin().lines().next().unwrap().unwrap() } struct AtomicF64 { diff --git a/examples/sink_id.rs b/examples/sink_id.rs index 1ffb7fb3..8d5eafb6 100644 --- a/examples/sink_id.rs +++ b/examples/sink_id.rs @@ -16,14 +16,10 @@ use web_audio_api::node::{AudioNode, AudioScheduledSourceNode}; fn ask_sink_id() -> String { println!("Enter the output 'device_id' and press "); - println!("- Leave empty for AudioSinkType 'none'"); - println!("- Use 0 for the default audio output device"); + println!("- type 'none' to disable the output"); + println!("- Leave empty ('') for the default audio output device"); - let input = std::io::stdin().lines().next().unwrap().unwrap(); - match input.trim() { - "0" => "none".to_string(), - i => i.to_string(), - } + std::io::stdin().lines().next().unwrap().unwrap() } fn main() {