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.
|
// 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.");
|
println!("Enter an integer value to change the frequency of the sine wave.");
|
||||||
while let Some(f) = read_freq() {
|
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
|
// 6. Optional deactivate. Not required since active_client will deactivate on
|
||||||
@@ -52,9 +53,10 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn read_freq() -> Option<f32> {
|
fn read_freq() -> Option<f32> {
|
||||||
let mut user_input = String::new();
|
Some(10000.0)
|
||||||
match io::stdin().read_line(&mut user_input) {
|
//let mut user_input = String::new();
|
||||||
Ok(_) => u16::from_str(user_input.trim()).ok().map(|n| n as f32),
|
//match io::stdin().read_line(&mut user_input) {
|
||||||
Err(_) => None,
|
// Ok(_) => u16::from_str(user_input.trim()).ok().map(|n| n as f32),
|
||||||
}
|
// Err(_) => None,
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user