A quiz buzzer that runs in the phone's browser: hold the button down and it buzzes until you let go. I made the first version for a trivia game in philosophy class, and rebuilt it in 2026.
Built with
JavaScript, no dependencies
Runs in
The browser, no backend
Weighs
118 KB, and works offline
Light and dark themes, in Spanish and English.
The trivia game
In my last year of technical high school, at UTU, I had to give a presentation on Anaximander in philosophy class. I ended it with a trivia game about what I had just explained, and the class answered by pressing the buzzer on their phones. There were about ten of us, and those without a phone teamed up with someone who had one.
That first version was a button and an MP3 that played once per tap, and it was enough. The buzzer got a laugh, and the answers showed people had been listening.
Why I rebuilt it
In 2026 I went back to polish it and publish the code as a proper project, clean enough for someone else to read. A real buzzer sounds for as long as you hold it, so the sound was the first thing to change. I also added a color picker for the button, with eight presets and a custom color, and made Buzzify a PWA, so it installs like an app and works offline.
The color picker is in the top bar, next to language and theme.
The sound
I didn't record the buzz. A Python script generates it from a model of an electromagnetic buzzer: a metal reed that a coil pulls twice per cycle of 60 Hz mains. Each pull is a hit, with the click of the contact and a few mechanical modes that keep ringing. The two hits in a cycle come out slightly different, and that difference is what makes it sound like a buzzer instead of a plain tone.
The ear is much more sensitive around 3 kHz than at 120 Hz, where the buzz sits, so two versions with the same energy can sound very different in loudness. That's why I set the level with A-weighting, which follows the ear: if I change the sound, the loudness you hear stays about the same.
A loop without a thump
If you just repeat the file, you hear a thump on every pass. Part of it is the short fade at the start and end of the file, which gets repeated too. The rest is that the sound isn't steady: the low end grows about 25% at the start, half of that in the first 50 ms. A loop that includes that stretch drops the low end every time it starts over, and it sounds like a kick drum.
So the browser builds the loop on the first tap on the page, before anyone presses the button, and plays it with the Web Audio API. It looks for the stretch where the low end is already close to its final level, and picks the loop length by signal correlation, without assuming the sound is periodic. The loop goes at the end of that stretch, where the sound has settled, and the join gets a 20 ms crossfade. On my computer it all takes between 4 and 14 ms.
I never told the algorithm how the sound is made, and the loop it picks is always a whole number of mains cycles. At the five sample rates I test, from 44.1 to 192 kHz, it's exactly 9, because the 150 ms minimum I set for the loop is 9 cycles at 60 Hz. If I raise the minimum, it picks other lengths, but always whole cycles.
The audio is AAC, with an Ogg Vorbis copy for browsers that can't play it. Vorbis adds more noise, so the mismatch at the join goes from -41 dB with AAC to -23 dB with Ogg (lower is better).
On an iPhone
Getting it to work on an iPhone took two more fixes. On iOS, a page can only start audio inside a user gesture, and on a touch screen the gesture counts when the finger lifts, not when it touches down. The buzzer sounds on press, so the first press stayed silent. The fix is a screen you tap once when the page opens.
The other problem is silent mode, which on iOS also mutes Web Audio. Newer versions of iOS let the page declare that it plays audio, and then silent mode leaves it alone. On older ones, a silent track generated in memory and played on a loop does the same job. The catch is that either way, it pauses whatever else the phone was playing.
Offline
You can't count on the classroom Wi-Fi, and a buzzer that stops working halfway through a game is useless. Everything the app needs to run fits in 118 KB, so a service worker saves it all on the first visit, and from then on it works without a connection. Online, each request goes to the network first and the saved copy gets updated. Offline, or if the network takes more than 3 seconds to answer, the saved copy is used.
How I test it
The tests use node:test. Some generate the same buzz in JavaScript at five sample rates and check the loop at each one. Others run the service worker against a fake network and cache, simulate a tap on an iPhone, and check that the app weight noted in the code matches the real one. They all run on every push.
What it doesn't do
Each phone is its own buzzer. They don't talk to each other and there is no server, so the app can't tell who pressed first. That's up to whoever runs the game.
Una chicharra para trivias que corre en el navegador del celular: mantenés apretado el botón y suena hasta que lo soltás. Hice la primera versión para una trivia en clase de filosofía, y en 2026 la rehice.
Hecho con
JavaScript, sin dependencias
Corre en
El navegador, sin backend
Pesa
118 KB, y anda sin conexión
Tema claro y oscuro, en español y en inglés.
La trivia
Fue en mi último año de bachillerato en UTU. En filosofía me tocó presentar a Anaximandro, y al final hice una trivia sobre lo que acababa de explicar, en la que la clase contestaba apretando el botón en el celular. Éramos unos diez, y los que no tenían celular se juntaron con alguien que sí.
Esa primera versión era un botón y un MP3 que sonaba una vez por toque, y alcanzó. La chicharra les causó gracia, y en las respuestas se notó que habían prestado atención.
Por qué la rehice
En 2026 la retomé para pulirla y publicar el código como un proyecto en serio, lo bastante prolijo como para que lo lea otro. Una chicharra de verdad suena mientras tenés apretado el botón, así que lo primero que cambió fue el sonido. También le sumé un selector de color para el botón, con ocho colores fijos o el que elijas, y la convertí en PWA, así que se instala como una app y anda sin conexión.
El selector de color está en la barra de arriba, al lado del idioma y el tema.
El sonido
El zumbido no lo grabé. Lo genera un script de Python a partir de un modelo de chicharra electromagnética: una lengüeta de metal que una bobina atrae dos veces por cada ciclo de una red eléctrica de 60 Hz. Cada tirón es un golpe, con el clic del contacto y algunos modos mecánicos que quedan resonando. Los dos golpes de cada ciclo salen un poco distintos, y esa diferencia es la que hace que suene a chicharra y no a un tono.
El oído es mucho más sensible cerca de los 3 kHz que en los 120 Hz donde está el zumbido, así que dos versiones con la misma energía pueden sonar con volúmenes muy distintos. Por eso ajusto el nivel con ponderación A, que sigue al oído: si cambio el sonido, el volumen que se oye queda más o menos igual.
Un bucle sin cortes
Si repetís el archivo tal cual, en cada vuelta se nota el corte. Una parte es la rampa breve con la que el archivo empieza y termina, que se repite con él. La otra es que el sonido no es parejo: el grave crece cerca de un 25 % al arrancar, la mitad en los primeros 50 ms. Un bucle que incluya ese tramo hace bajar el grave cada vez que vuelve a empezar, y se oye como un bombo.
Así que el navegador arma el bucle con el primer toque en la página, antes de que nadie apriete el botón, y lo reproduce con la Web Audio API. Busca el tramo donde el grave ya está cerca de su nivel final y elige el largo del bucle por correlación de señal, sin suponer que el sonido es periódico. El bucle va al final de ese tramo, donde el sonido ya se asentó, y la unión lleva un crossfade de 20 ms. En mi computadora todo eso tarda entre 4 y 14 ms.
Al algoritmo nunca le dije cómo se genera el sonido, y el bucle que elige siempre dura un número entero de ciclos de la red eléctrica. En las cinco frecuencias de muestreo que pruebo, de 44,1 a 192 kHz, son 9 exactos, porque el mínimo de 150 ms que le puse al bucle son 9 ciclos a 60 Hz. Si subo el mínimo, elige otros largos, pero siempre en ciclos enteros.
El audio va en AAC, con una copia en Ogg Vorbis para los navegadores que no lo reproducen. Vorbis agrega más ruido, así que el desajuste en la unión pasa de -41 dB con AAC a -23 dB con Ogg (cuanto más bajo, mejor).
En un iPhone
Para que ande en un iPhone hicieron falta dos arreglos más. En iOS una página solo puede empezar a sonar dentro de un gesto del usuario, y en una pantalla táctil el gesto cuenta cuando el dedo se levanta, no cuando se apoya. La chicharra suena al apretar, así que la primera pulsación quedaba muda. Lo resolví con una pantalla que se toca una vez al abrir la página.
El otro problema es el modo silencio, que en iOS alcanza también a Web Audio. Las versiones más recientes de iOS dejan que la página declare que reproduce audio, y entonces el modo silencio no la afecta. En las anteriores, una pista silenciosa generada en memoria y repetida en bucle hace lo mismo. La contra es que, de las dos maneras, se pausa lo que el celular estuviera reproduciendo.
Sin conexión
Con el wifi del salón no se puede contar, y una chicharra que deja de andar a mitad de la trivia no sirve. Todo lo que la app necesita para funcionar entra en 118 KB, así que un service worker lo guarda en la primera visita, y de ahí en adelante anda sin conexión. Con conexión, cada pedido va primero a la red y la copia guardada se actualiza. Sin conexión, o si la red tarda más de 3 segundos en contestar, se usa la copia.
Cómo la pruebo
Las pruebas usan node:test. Unas generan el mismo zumbido en JavaScript a cinco frecuencias de muestreo y revisan el bucle en cada una. Otras corren el service worker con una red y una caché de mentira, simulan un toque en un iPhone y verifican que el peso de la app anotado en el código sea el real. Corren todas en cada push.
Lo que no hace
Cada celular es una chicharra aparte. No se comunican entre sí ni hay un servidor, así que la app no sabe quién apretó primero. Eso lo decide quien conduce la trivia.