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