SIGNALMANUSCRIPT

... / --Decorative S and M. Not translator output.

How Morse Code Audio Is Generated: Tones, Waveforms and WAV Files

Morse audio on this site starts as a list of events. Each dot and dash has a start time, a duration, and an end time. Gaps are events too, and they schedule silence. Playback, the waveform, the duration readout, and the WAV file all use that list, so they describe one signal.

A tone is a sine wave. The sample at time t is amplitude times an envelope times the sine of two pi f t. The default frequency f is 600 hertz, and you can set any frequency from 300 to 1200. The default amplitude is a quarter of full scale. That is a conservative starting gain, not a promise about loudness on every speaker or pair of headphones.

Clicks come from starting a wave at a high value. A short attack and release, 5 milliseconds unless the tone is shorter than that, brings the amplitude up and down. The ramps are shortened so they cannot overlap on a very short dot. The scheduled length of the tone stays the same. During a gap the samples stay at zero. No decorative beep is mixed in.

The browser plays by scheduling oscillators on the audio clock, not by stacking interface timers for each dot. Pressing play resumes the audio context if the browser suspended it. Pause stores the position and resume continues from that position. Stop releases the scheduled tones. A second play stops the first one first. Sound does not start when the page loads.

A WAV download is PCM, mono, 16-bit, little-endian. The default rate is 44100 hertz, with 48000 available. The header carries RIFF, WAVE, a fmt chunk with format code 1, one channel, the rate, the byte rate, the block alignment, and 16 bits. The data chunk length matches the sample count times two bytes. Samples are clamped into the signed 16-bit range.

Duration is checked before the buffer is built. One file may last up to 180 seconds, with at most 10 repeats and one channel. At 44100 hertz, 180 seconds is 7,938,000 samples and 15,876,000 bytes of audio data before the header. Longer requests are refused with a reason, and you can raise the speed or shorten the text. The filename uses the speed and frequency, such as morse-signal-20wpm-600hz.wav, and it does not include the message.

The on-screen timeline is the envelope: high for tone, low for silence, with character and word boundaries. It is not a sketch of 600 oscillations per second. Zoom, fit, labels, and an SVG download operate on that drawing. If you change speed or frequency during playback, the player stops and waits for a new play command.

HELLO WORLD at 20 WPM is a concrete check. Encode it, build the events, and the WAV duration matches the last event's end time within a sample. There is no separate quality score and no claim that one sample rate sounds better by a measured amount. The file is simply the samples of the signal you asked for.

Pause keeps the playhead where the clock stopped. Resume schedules only the events that have not finished. Stop returns the player to silence and drops the scheduled oscillators. If the browser has no Web Audio implementation, the status line says so instead of pretending a decorative control made a sound. Generated object URLs for downloads are revoked after the save starts.

A 600 hertz tone completes 600 cycles in one second. At 44100 samples per second there are about 73.5 samples in each cycle. The encoder writes those samples as integers. A silent gap writes zeros, so a hex dump of a gap is not a quiet recording of room noise. It is digital silence for the length the timing model requested.

Block alignment is one channel times 16 bits divided by 8, which is 2 bytes. Byte rate is the sample rate times that alignment: 88200 at 44100 hertz, or 96000 at 48000 hertz. Data size is the sample count times 2. If those header fields disagreed with the bytes that follow, the file would not be a playable WAV. The generator sets them from the same counts.

Copy audio settings writes the speed, frequency, volume, and timing mode as text. Reset restores the form defaults and stops playback. You still have to press play. Volume at 25 percent is the starting point because full scale is harsh on some devices, and no single percentage is safe everywhere.

Sample rendering uses one function for the file you download. A worker script in the project can run that same function off the main thread for a long buffer. A short line such as HELLO at 20 WPM is small enough to encode directly, and the file is still PCM.

Try the tools

Generate a file in the audio generator.

Short answers

Does the page play audio by itself?

No. Playback waits for a button.

Are the examples complete?

Yes. Sequences such as TEST include every letter, and timing figures come from the event rules above.

Is this a certificate or an emergency service?

No. The pages explain and generate signals on your device. They do not call for help or grant a license.