:py:mod:`enigma.keyer` ====================== .. py:module:: enigma.keyer .. autoapi-nested-parse:: A Morse code keyer. A Morse "key" is a device with a button used to encode the carrier wave with a Morse signal. Morse operators use these to produce the familiar "dits" and "dahs" of Morse code. The Keyer class converts dots and dashes into an encoded carrier waveform and plays it audibly. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: enigma.keyer.Keyer Attributes ~~~~~~~~~~ .. autoapisummary:: enigma.keyer.MORSE_DIT_FREQ enigma.keyer.MORSE_DIT enigma.keyer.MORSE_DAH enigma.keyer.FREQUENCY enigma.keyer.SAMPLE_RATE .. py:data:: MORSE_DIT_FREQ :annotation: = 10 .. py:data:: MORSE_DIT :annotation: = 1 .. py:data:: MORSE_DAH :annotation: = 3 .. py:data:: FREQUENCY :annotation: = 440 .. py:data:: SAMPLE_RATE :annotation: = 44100 .. py:class:: Keyer(morse) Convert Morse code to audio and play it. .. py:method:: create_binary_signal(self, morse) Converts Morse code into a binary signal. For example, ".- ." becomes "1011100001" :param morse: dot-and-dash Morse code :type morse: str :return: binary Morse code signal :rtype: np.ndarray .. py:method:: convert_audio(self) Convert binary signal to audio. Encode sine wave with binary signal and create playable audio. :return: 16-bit audio waveform :rtype: np.ndarray .. py:method:: play(self) Play Morse code. In the case of audio errors (i.e. on CI system with no sound card), catch exception and notify.