Building Voice Debate in Toroners — The Real-Time Audio Challenge
Why Voice Matters in Debate
Voice and text carry different things.
Text transmits logic with precision. Voice transmits conviction, tone, and confidence — things that move an audience in ways that text often can't. In competitive debate, how something is said matters as much as what is said.
That's the experience I wanted Toroners to capture. Voice debate feels alive in a way that text exchanges don't.
Managing the Microphone
The central challenge in voice debate isn't audio quality — it's microphone management.
In a real debate, a moderator controls who can speak and when. In an app, that needs to be automated.
The basic model: participants can request the floor. When the current speaker finishes, the next in queue automatically gets the microphone. Listeners can hear everything but can't speak unless they join the queue.
The in-app "microphone" purchase item increases a user's priority in the speaking queue — the same way items in a game boost a character's capabilities, applied to debate access.
WebRTC
Real-time audio uses WebRTC — the standard protocol for peer-to-peer media communication in browsers and apps.
WebRTC's P2P model keeps latency low, which matters a lot for live conversation. But P2P has a scaling problem: each participant needs a direct connection to every other participant, and the number of connections grows quadratically with the number of users.
For debates with many participants, I switched to routing audio through an SFU (Selective Forwarding Unit) — a relay server that receives each participant's stream and forwards it to everyone else. This keeps connection count linear and handles large rooms without falling apart.
Adapting to Mobile Networks
Mobile networks are unpredictable.
WiFi works fine; LTE has occasional drops; subway tunnels cut out entirely. I added adaptive bitrate logic: the audio quality adjusts automatically based on connection strength. Strong signal → high quality audio. Weak signal → lower bitrate to preserve connectivity over fidelity.
Dropping quality is always better than dropping the connection mid-debate.
What It Taught Me
Voice features are among the hardest things to build in a mobile app.
Text can be async — latency barely matters. Voice is real-time — 100ms of delay makes conversation awkward, 500ms makes it unusable. Debugging audio issues requires a different mental model than debugging UI bugs.
This feature pushed me deepest into networking and media handling. It was the hardest part of Toroners, and the part I learned the most from.