text_to_morse_sounds: Converts text to Morse code sounds

Description Usage Arguments Value Examples

View source: R/morse.R

Description

Converts text to Morse code sounds

Usage

1
2
3
4
5
6
7
text_to_morse_sounds(
  text,
  pulse_duration = 0.25,
  play = TRUE,
  sampling_freq = 8000,
  carrier_freq = 440
)

Arguments

text

The text to convert. Ignores anything except the letters a-z (both upper and lower case), numbers, and spaces.

pulse_duration

How long the dot lasts, in seconds. Default is 0.25 seconds. Bars last for three times as long.

play

Whether to play the resulting sound immediately. Default is TRUE.

sampling_freq

The sampling frequency. Default is 8000.

carrier_freq

The carrier tone. Deafult is 440 Hz (flat A).

Value

A soundwave matrix that can be played via audio::play.

Examples

1
2
3
4
5
## Not run: 
sound <- text_to_morse_sounds("SOS SOS SOS")
audio::play(sound, rate = 8000)
audio::play(sound, rate = 24000)
## End(Not run)

xmarquez/morsecode documentation built on Jan. 23, 2022, 12:47 p.m.