Morse Code Converter ā Text to Morse with Web Audio Playback
Overview Morse Code Converter encodes text to Morse code and decodes Morse back to text, with real audio playback. š https://devnestio.pages.dev/morse-code/ Features Text ā Morse: all letters (AāZ), digi
Overview
Morse Code Converter encodes text to Morse code and decodes Morse back to text, with real audio playback.
š https://devnestio.pages.dev/morse-code/
Features
- Text ā Morse: all letters (AāZ), digits (0ā9), punctuation
-
Morse ā Text: decodes dot/dash sequences;
/for word breaks - Audio playback via the Web Audio API with smooth tone fade-in/out
- Adjustable WPM: 5ā40 words per minute (PARIS standard)
- Visual flash: indicator pulses in sync with audio
- Reference table: all 36 character codes visible at a glance
Example
SOS ā ... --- ...
HELLO WORLD ā .... . .-.. .-.. --- / .-- --- .-. .-.. -..
Tech: sample-accurate audio scheduling
Timings use the Web Audio API scheduler rather than setTimeout, giving sample-accurate playback:
gain.gain.linearRampToValueAtTime(0.5, t + 0.005); // fade in
gain.gain.setValueAtTime(0.5, t + dur/1000 - 0.005); // sustain
gain.gain.linearRampToValueAtTime(0, t + dur/1000); // fade out
Dot duration = 1200 / WPM ms (PARIS standard). Dash = 3Ć dot. Letter gap = 3Ć dot. Word gap = 7Ć dot.
š Try it: https://devnestio.pages.dev/morse-code/
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes ā full credit and traffic to the original publisher.