All projects
x1biu
A 1v1 whistling battle: the microphone captures the pitch and the server scores tuning in real time over WebSocket.

About the project
A proudly useless project: two players join a queue, get matched, the same song plays for both and each one whistles along with the melody. Whoever whistles more in tune wins and climbs the ranking.
The browser captures the microphone with the Web Audio API and finds the whistle frequency through autocorrelation, with no libraries. Each frame goes over WebSocket to Django Channels, which compares it with the song reference in cents, normalizing the octave, and sends both players their scores live.
Matchmaking runs in a periodic Celery Beat task, and each match keeps its pitch history to draw the chart afterwards.
Read the article: HzWhat shipped
- In-browser pitch detection through autocorrelation, with a silence gate and a whistle range
- Scoring in cents with octave normalization
- Real-time matches with Django Channels and WebSocket
- Queue and matchmaking with Celery Beat and Redis
- Global ranking and match history with a pitch chart
How it works
- Web Audio API
- Autocorrelation
- Next.js
- WebSocket
- Django Channels
- Django + DRF
- Scoring in cents
- Celery Beat
- PostgreSQL
- Redis