try our demo in spaces!
A simple Python package that converts Morse code into an audio file. This tool supports customizable frequencies and dot durations to generate Morse code tones.
- Convert Morse code (
.,-, and spaces) into audio. - Customize the tone frequency and dot duration.
- Outputs a
.wavfile of the generated Morse code audio.
You can install the package using pip:
pip install morse-to-audioOnce installed, you can use the morse-to-audio command in your terminal to convert Morse code to audio:
morse-to-audio ".- .- -" --frequency 700 --dot_duration 100morse_code: The Morse code to convert. Use.for dots,-for dashes, and spaces between words.--frequency: The frequency of the tone in Hz. Default is700.--dot_duration: The duration of a dot in milliseconds. Default is100.
morse-to-audio "-- .- -." --frequency 750 --dot_duration 120This will generate a .wav file with the Morse code for "MAN" and save it to your system.
The package uses the pydub library to generate sine waves representing the Morse code tones. Each dot, dash, and space is converted into an audio segment and combined into a final output file.
This project is licensed under the MIT License. See the LICENSE file for more details.