play with FSK more

This commit is contained in:
2025-03-25 21:49:51 -04:00
parent fd5feaca3f
commit 7ef059fa5b
3 changed files with 58 additions and 15 deletions

View File

@@ -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 => {