Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CWI - Morse Code Audio Generator

Logo

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.

Table of Contents

Features

  • 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.

Installation

From Source

  1. Clone the repository:

    git clone https://github.com/CoMakar/CWI.git
    cd CWI
  2. 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.*

From Release

Pre-built version is available. You can download it from the Releases.

Note

Executable was built using PyInstaller [Windows 10 x64]

Build it yourself

Note

This project uses Pipenv to manage virtual environment and all the dependencies. Make sure to install it first.

  1. Clone the repository:

    git clone https://github.com/CoMakar/CWI.git
    cd CWI
  2. Install with dev dependencies

    pipenv install --dev
  3. Use make file or pyinstaller itself to build the project

    make all
    # - or -
    pyinstaller cwi.spec
  4. Navigate to ./dist/ or ./bin/cwi directory to find the executable

    cd ./bin/cwi
    ./cwi sos
    # - or -
    cd ./dist
    ./cwi sos

Command-line Options

  • --tone-generator-type -t : Specifies the type of tone generator. Options: sine, saw, triangle, square. Default is sine.
  • --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 the message argument if provided.
  • --output-file -o : Writes the audio output to a .wav file instead of playing it back.

Examples

# 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.wav

References

Footnotes

  1. Morse code \ Crypto Museum : https://www.cryptomuseum.com/radio/morse/ (20.09.2024)

About

- CWI - is a command-line instrument capable of generating and playing Morse code audio

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages