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