morse

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 10 Imported by: 0

README

Untitled

Features

  • Output string representation to stdout.
  • Output sound representation to a .wav file via the --output flag.
  • Supports short flags like -s (sound) and -o (output).
  • Configure sound pitch, speed, and tone.

Quickstart

To translate text to Morse code, run:

morse 'Vamos' -s

This command will write the string representation to standard output and play it on your speakers.

To name the ouput file something different, use the --file-name (-f) flag. For example:

morse 'Lets go, Carlos, lets go' -sf 'carlitos.wav'

Configuration

By default, morse plays a 700Hz sine wave at 20 words per minute. But you can change its pitch, speed, and tone.

Morse supports configuring the ouptut sound using the --pitch, --speed, and --tone flags.

Pitch

You can set the pitch anywhere from 300Hz to 1000Hz via the --pitch flag.

morse 'Ace' -s --pitch 500

Speed

Morse code speed is measured in words per minute (wpm). Because characters might have different lengths, the convention is to meausre words per minute using the word "PARIS " with a space at the end.

morse produces sound outputs at 20wpm, try adjusting it to anything between 5-40 wpm.

morse 'What a magnificent shot' -s --speed 35

Tone

Set the output tone to one of sine, triangle, sawtooth and square. Via the --tone flag.

morse 'And the champion of the 2025 Nitto ATP finals is Jannik Sinner' -s --tone triangle
  • sine: The base, smooth. Makes up all other waves.
  • square: Richer and buzzier.
  • triangle: Between sine and square.
  • sawtooth: More friction and the buzziest of all.

Roadmap

  • Enable saving sound to file

  • Make functions run in parallel

  • Set up short-version flags

  • Extend punctuation

  • Add a default file name for better ergonomics

  • Enable editing sound qualities

    • Speed
    • Pitch
    • Tone
  • Improve efficiency of steream construction / duplication.

  • Improve error handling in goroutine

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
play command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL