]> code.octet-stream.net Git - m17rt/blob - tools/m17rt-mod/src/main.rs
Add metadata to m17rt-mod Cargo.toml
[m17rt] / tools / m17rt-mod / src / main.rs
1 use m17app::app::M17App;
2 use m17app::soundmodem::{
3 InputRrcFile, InputSoundcard, NullInputSource, NullOutputSink, OutputRrcFile, Soundmodem,
4 };
5 use m17codec2::{Codec2Adapter, WavePlayer};
6 use std::path::PathBuf;
7
8 pub fn mod_test() {
9 let in_path = PathBuf::from("../../../Data/test_vk7xt_8k.wav");
10 let out_path = PathBuf::from("../../../Data/mymod.rrc");
11 let soundmodem =
12 Soundmodem::new_with_input_and_output(NullInputSource::new(), OutputRrcFile::new(out_path));
13 let app = M17App::new(soundmodem);
14 app.start();
15 std::thread::sleep(std::time::Duration::from_secs(1));
16 println!("Beginning playback...");
17 WavePlayer::play(in_path, app.tx());
18 println!("Playback complete, terminating in 5 secs");
19 std::thread::sleep(std::time::Duration::from_secs(5));
20 }
21
22 fn main() {
23 env_logger::init();
24 mod_test();
25 }