
Morse Code Translator with Audio Playback — Built in JavaScript
I built a Morse code translator that converts text to dots and dashes — and plays the audio. The Build The encoding is straightforward — a lookup table mapping each character to its Morse pattern: const MORSE = { A : " .- " , B : " -... " , C : " -.-. " , // ... etc }; The audio part uses the Web Audio API: const ctx = new AudioContext (); const osc = ctx . createOscillator (); osc . frequency . value = 600 ; // classic Morse tone Dots play for 60ms, dashes for 180ms (3x). Letter gaps are 180ms, word gaps 420ms. Features Encode text → Morse Decode Morse → text Audio playback at 600Hz Full A-Z, 0-9, punctuation reference chart Copy results Try the Morse Code Translator Related tools: Binary Converter Roman Numeral Converter Text to Binary Full toolkit: devtools-site-delta.vercel.app
Continue reading on Dev.to Tutorial
Opens in a new tab




