]>
code.octet-stream.net Git - m17rt/blob - tools/m17rt-mod/src/main.rs
1 use m17app
::app
::M17App
;
2 use m17app
::soundmodem
::{
3 InputRrcFile
, InputSoundcard
, NullInputSource
, NullOutputSink
, OutputRrcFile
, OutputSoundcard
,
6 use m17codec2
::{Codec2Adapter
, WavePlayer
};
7 use std
::path
::PathBuf
;
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_with_input_and_output(NullInputSource
::new(), output
);
15 let app
= M17App
::new(soundmodem
);
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));