play with FSK more
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use fsk::fsk_modulate;
|
||||
use audio::play_audio;
|
||||
use fsk::afsk_modulate;
|
||||
use text_io::scan;
|
||||
use std::io;
|
||||
|
||||
@@ -15,9 +16,14 @@ fn main() -> Result<(), io::Error> {
|
||||
match a {
|
||||
1 => {
|
||||
println!("1 has been pressed! No test tone implemented yet");
|
||||
let tone: signal;
|
||||
tone = fsk_modulate([0x25, 0x08, 0x00, 0x25, 0xA0]);
|
||||
play_audio(tone);
|
||||
let tone: Vec<f32>;
|
||||
tone = afsk_modulate(&[
|
||||
0b10101010, 0b01010101, 0b10101010, 0b01010101, 0b10101010, 0b01010101, 0b10101010, 0b01010101, 0b10101010, 0b01010101,
|
||||
0b1000101,0b11111111,0b1000101,0b11111111,0b11111111,0b1000101,0b11111111,0b11111111,0b1000101,0b11111111,0b11111111,
|
||||
], 1700.0);
|
||||
let repeated_tone: Vec<f32> = tone.iter().cloned().cycle().take(tone.len() * 10).collect();
|
||||
|
||||
play_audio(&repeated_tone);
|
||||
return main();
|
||||
},
|
||||
0 => {
|
||||
|
Reference in New Issue
Block a user