Some sounds are already produced
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -40,7 +40,8 @@ fn main() {
|
||||
// 5. wait or do some processing while your handler is running in real time.
|
||||
println!("Enter an integer value to change the frequency of the sine wave.");
|
||||
while let Some(f) = read_freq() {
|
||||
prod.try_push(1203.0).unwrap();
|
||||
println!("Pushing to the prod");
|
||||
prod.try_push(f);
|
||||
}
|
||||
|
||||
// 6. Optional deactivate. Not required since active_client will deactivate on
|
||||
@@ -52,9 +53,10 @@ fn main() {
|
||||
}
|
||||
|
||||
fn read_freq() -> Option<f32> {
|
||||
let mut user_input = String::new();
|
||||
match io::stdin().read_line(&mut user_input) {
|
||||
Ok(_) => u16::from_str(user_input.trim()).ok().map(|n| n as f32),
|
||||
Err(_) => None,
|
||||
}
|
||||
Some(10000.0)
|
||||
//let mut user_input = String::new();
|
||||
//match io::stdin().read_line(&mut user_input) {
|
||||
// Ok(_) => u16::from_str(user_input.trim()).ok().map(|n| n as f32),
|
||||
// Err(_) => None,
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user