This is a Python program that translates English text to Morse code and vice versa. It also plays sound for Morse code symbols using pygame.
- Convert English text to Morse code
- Convert Morse code to English text
- Play sound for Morse code symbols (
dot.wavanddash.wav)
Make sure you have Python and the following dependencies installed:
pip install pygame- Run the script:
python morse.py
- Choose an option:
- 1: Convert English to Morse code
- 2: Convert Morse code to English
- Enter your text and see the translation.
- If converting to Morse code, you will hear sounds for dots and dashes.
├── morse.py # Main script
├── sound.py # Sound handling module
├── dot.wav # Sound for dot
├── dash.wav # Sound for dash
├── README.md # Documentation
Input: SOS
Output: ... --- ... (With sound playback)
Input: ... --- ...
Output: SOS
- Ensure
dot.wavanddash.wavexist in the same directory asmorse.py. - The script ignores unsupported characters.
This project is open-source and free to use.