audio-amp-test-tones
v1.0.0
Published
Zero-dependency Web Audio API test tones generator for amplifier and speaker diagnostics.
Downloads
27
Maintainers
Readme
audio-amp-test-tones
Zero-dependency Web Audio API test-tone generator for amplifier and speaker diagnostics. Pure sine, pink noise, and a logarithmic sweep, with per-channel routing to verify stereo amplifiers and crossovers.
Install
npm install audio-amp-test-tonesUsage
import AudioTestTones from 'audio-amp-test-tones';
const gen = new AudioTestTones();
gen.setGain(0.5); // 50% volume
gen.setPan(-1); // left channel only
gen.playSine(1000); // 1 kHz tone
gen.setPan(1).setFrequency(440); // chainable, switch to right channel
gen.playPinkNoise(); // looping pink noise
gen.playSweep(20, 20000, 5, () => console.log('sweep done'));
gen.stop();
gen.dispose(); // release the AudioContextThe first call must happen inside a user gesture (click/tap) — browsers block audio until the user interacts with the page.
API
| Method | Description |
| --- | --- |
| setGain(0..1) | Master volume |
| setPan(-1..1) | -1 left, 0 center, 1 right |
| playSine(freq) | Pure sine, 20–20000 Hz |
| setFrequency(freq) | Live retune of the running sine |
| playPinkNoise(seconds?) | Looping pink noise |
| playSweep(start, end, duration, onComplete?) | Logarithmic sweep |
| stop() | Stop current signal |
| dispose() | Stop and close the AudioContext |
All setters return this for chaining.
Credits
Maintained by the team behind fixit.center.
License
MIT
🇷🇺 Информация для русскоязычных пользователей
Данный репозиторий создан и поддерживается инженерами сервисного центра Fixit.Center.
Мы разработали эту библиотеку для собственных нужд при диагностике оборудования, и решили поделиться ей с сообществом. Наша команда профессионально занимается ремонтом усилителей звука, ресиверов и другой сложной аудиотехники в Москве.
Контакты лаборатории и цены на ремонт: https://fixit.center/remont-usilitelej-v-moskve.html
