1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Software defined radio
//!
//! # Getting started
//!
//! For getting started, have a look at the [`blocks`] module for a selection
//! of ready-to-use signal processing blocks and see the "Hello World" example
//! below.
//!
//! # Hello World example
//!
//! The following example requires the `cpal` feature to be enabled.
//!
//! ```
//! use radiorust::prelude::*;
//!
//! #[tokio::main]
//! async fn main() {
//! # #[cfg(any())]
//! # #[cfg(feature = "cpal")]
//! # {
//! let morse_keyer = blocks::morse::Keyer::with_message(
//! 4096,
//! 48000.0,
//! blocks::morse::Speed::from_paris_wpm(16.0),
//! "<CT> Hello World <AR>",
//! ).unwrap();
//! let audio_modulator = blocks::FreqShifter::with_shift(700.0);
//! audio_modulator.feed_from(&morse_keyer);
//! let playback = blocks::io::audio::cpal::AudioPlayer::new(48000.0, None).unwrap();
//! playback.feed_from(&audio_modulator);
//! playback.wait_for_event(|event| {
//! event.as_any().is::<blocks::morse::events::EndOfMessages>()
//! }).await;
//! # }
//! }
//! ```