Skip to content

Commit 38c1f75

Browse files
authored
Merge branch 'main' into feature/no-interior-mutability-with-atomics
2 parents 6a7ff49 + 135a735 commit 38c1f75

File tree

3 files changed

+15
-25
lines changed

3 files changed

+15
-25
lines changed

examples/microphone.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,21 @@ use web_audio_api::node::AudioNode;
1818

1919
fn ask_source_id() -> Option<String> {
2020
println!("Enter the input 'device_id' and press <Enter>");
21-
println!("- Use 0 for the default audio input device");
21+
println!("- Leave empty ('') for the default audio input device");
2222

2323
let input = std::io::stdin().lines().next().unwrap().unwrap();
2424
match input.trim() {
25-
"0" => None,
25+
"" => None,
2626
i => Some(i.to_string()),
2727
}
2828
}
2929

3030
fn ask_sink_id() -> String {
31-
println!("Enter the output 'sink' and press <Enter>");
32-
println!("- Use 0 for the default audio output device");
31+
println!("Enter the output 'device_id' and press <Enter>");
32+
println!("- type 'none' to disable the output");
33+
println!("- Leave empty ('') for the default audio output device");
3334

34-
let input = std::io::stdin().lines().next().unwrap().unwrap();
35-
match input.trim() {
36-
"0" => "".to_string(),
37-
i => i.to_string(),
38-
}
35+
std::io::stdin().lines().next().unwrap().unwrap()
3936
}
4037

4138
fn main() {

examples/roundtrip_latency_test.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,21 @@ use std::sync::Arc;
3232

3333
fn ask_source_id() -> Option<String> {
3434
println!("Enter the input 'device_id' and press <Enter>");
35-
println!("- Use 0 for the default audio input device");
35+
println!("- Leave empty ('') for the default audio input device");
3636

3737
let input = std::io::stdin().lines().next().unwrap().unwrap();
3838
match input.trim() {
39-
"0" => None,
39+
"" => None,
4040
i => Some(i.to_string()),
4141
}
4242
}
4343

4444
fn ask_sink_id() -> String {
45-
println!("Enter the output 'sink' and press <Enter>");
46-
println!("- Use 0 for the default audio output device");
45+
println!("Enter the output 'device_id' and press <Enter>");
46+
println!("- type 'none' to disable the output");
47+
println!("- Leave empty ('') for the default audio output device");
4748

48-
let input = std::io::stdin().lines().next().unwrap().unwrap();
49-
match input.trim() {
50-
"0" => "none".to_string(),
51-
i => i.to_string(),
52-
}
49+
std::io::stdin().lines().next().unwrap().unwrap()
5350
}
5451

5552
struct AtomicF64 {

examples/sink_id.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ use web_audio_api::node::{AudioNode, AudioScheduledSourceNode};
1616

1717
fn ask_sink_id() -> String {
1818
println!("Enter the output 'device_id' and press <Enter>");
19-
println!("- Leave empty for AudioSinkType 'none'");
20-
println!("- Use 0 for the default audio output device");
19+
println!("- type 'none' to disable the output");
20+
println!("- Leave empty ('') for the default audio output device");
2121

22-
let input = std::io::stdin().lines().next().unwrap().unwrap();
23-
match input.trim() {
24-
"0" => "none".to_string(),
25-
i => i.to_string(),
26-
}
22+
std::io::stdin().lines().next().unwrap().unwrap()
2723
}
2824

2925
fn main() {

0 commit comments

Comments
 (0)