Professional‑grade signal generator for acoustics, hearing tests, instrument tuning, and sound experimentation. Real‑time frequency control from 1 Hz to 20 kHz, adjustable volume, and live waveform visualizer.
An audio tone generator produces a continuous electronic signal at a specific frequency and waveform. A pure sine wave, mathematically described as y(t) = A·sin(2πft+φ), represents the simplest periodic oscillation—containing only the fundamental frequency with no harmonics. Square, triangle, and sawtooth waves introduce specific harmonic overtones and are fundamental in sound synthesis, electronic testing, and acoustic research. This tool leverages the Web Audio API’s OscillatorNode, offering sub‑millisecond timing precision and 32‑bit floating‑point gain control.
Frequency, measured in Hertz (Hz), determines the perceived pitch. The human auditory system, centered on the cochlea, converts sound pressure waves into neural signals via tonotopic mapping—different frequencies stimulate specific regions along the basilar membrane. Young, healthy hearing typically ranges from 20 Hz (low rumble) to 20 kHz (high pitch), with peak sensitivity between 2–5 kHz. Concert pitch A4 is 440 Hz.
Sine: Fundamental only → pure, mellow tone. Square: Odd‑numbered harmonics (1f, 3f, 5f...) → bright, hollow. Triangle: Odd harmonics with amplitudes diminishing as 1/n² → smooth, flute‑like. Sawtooth: All integer harmonics (1f, 2f, 3f...) → rich, brassy. These waveforms form the basis of subtractive synthesis (Moog, ARP).
Clicking “Play Tone” triggers the browser to create or resume an AudioContext (initial state is often suspended due to autoplay policies). An OscillatorNode is instantiated, configured with the selected waveform type and frequency, and connected to a GainNode for volume control. The gain node finally connects to the AudioDestinationNode (your speakers or headphones). The oscillator provides a steady, phase‑continuous, and drift‑free tone until stopped. The visual waveform is drawn independently using JavaScript’s requestAnimationFrame loop, simulating an oscilloscope view synchronized to the current settings. All digital audio processing occurs at the internal sample rate (typically 44.1 kHz or 48 kHz).
Latency & Performance: Web Audio is hardware‑accelerated, offering typical output latency below 10 ms. Frequency changes are applied in real‑time, maintaining phase to avoid audible clicks or pops.
A home theater enthusiast used a slow frequency sweep with a sawtooth wave (rich in harmonics) from 30 Hz to 120 Hz to excite room modes. A pronounced null at 63 Hz was identified, indicating a standing wave caused by room dimensions. Repositioning the subwoofer away from the wall reduced this dip by approximately 12 dB, resulting in a smoother bass response. The precision and stability of the browser‑based digital oscillator eliminated the variability often encountered with test tones from physical media.
| Parameter | Web Audio Tone Generator | Hardware Function Generator |
|---|---|---|
| Frequency Range | 1 – 20,000 Hz (audible spectrum) | µHz to MHz+ |
| Frequency Accuracy | Very high (±1 cent relative), based on system clock | Extremely high (±0.1 ppm typical with TCXO/OCXO) |
| Distortion (THD) | ~0.01% (depends on browser/OS audio stack) | As low as 0.001% (high‑end models) |
| Amplitude Control | Linear gain 0…1 (32‑bit float) | Precision analog or high‑resolution DAC (14‑bit to 24‑bit) |
| Portability & Cost | Any modern browser, no installation, free | Benchtop equipment, requires purchase |
| Waveforms | Sine, Square, Triangle, Sawtooth (standard types) | Plus Arbitrary, Pulse, Noise, AM/FM modulation |