CWI - is a command-line instrument capable of generating and playing Morse code audio. It takes a text message as argument or from file, converts it to Morse code, and plays the corresponding audio tone or saves it as a .wav file.
- Supports Latin and Cyrillic symbols, and some other special characters1.
- Converts text input into Morse code and generates corresponding audio tones.
- Customizable frequency, sample rate, and WPM.
- Supports multiple tone generator types: Sine, Sawtooth, Triangle, Square.
- Plays the generated audio directly or saves it to a WAV file.
- Supports both command-line arguments and reading messages from an input file.
- Debugging mode with detailed logging output.
-
Clone the repository:
git clone https://github.com/CoMakar/CWI.git cd CWI -
Install the project using using pip:
pip install . # - or - python3 -m pip install . # - or - # (if you have multiple python versions installed) py -*.* -m pip install .
This will install all necessary dependencies as specified in the setup.py file. The cwi command should be accessible from anywhere on your system.
Important
Note that minimal python version required is 3.11.*
Pre-built version is available. You can download it from the Releases.
Note
Executable was built using PyInstaller [Windows 10 x64]
Note
This project uses Pipenv to manage virtual environment and all the dependencies. Make sure to install it first.
-
Clone the repository:
git clone https://github.com/CoMakar/CWI.git cd CWI -
Install with dev dependencies
pipenv install --dev
-
Use make file or pyinstaller itself to build the project
make all # - or - pyinstaller cwi.spec -
Navigate to ./dist/ or ./bin/cwi directory to find the executable
cd ./bin/cwi ./cwi sos # - or - cd ./dist ./cwi sos
--tone-generator-type-t: Specifies the type of tone generator. Options:sine,saw,triangle,square. Default issine.--frequency-f: Sets the tone generator frequency in Hz. Range: 80-8000. Default is 800Hz.--sample-rate-r: Sets the audio output sample rate in Hz. Range: 8000-96000. Default is 44100Hz.--words-per-minute-w: Specifies the Morse code speed in words per minute (WPM). Range: 5-30. Default is 20 WPM.--debug: Enables debug mode for more verbose logging.--input-file-i: Specifies a file containing the message to convert to Morse code. Ignores themessageargument if provided.--output-file-o: Writes the audio output to a.wavfile instead of playing it back.
# View all options
cwi --help
# Play a simple morse message
cwi sos
# Play a long morse message
cwi "alfa bravo charlie hotel"
# Save audio to a file
cwi "hello world" --output-file hello_world.wav
# Use a sawtooth wave generator at 1000 Hz
cwi "cq cq cq de 9987 gn sk" -t saw -f 1000
# Read a message from a text file and save the audio:
cwi --input-file message.txt --output-file message_audio.wavFootnotes
-
Morse code \ Crypto Museum : https://www.cryptomuseum.com/radio/morse/ (20.09.2024) ↩
