I think i have finished working on my personal ai agent AKA NERO, so i made some changes in the voice mode so lemme talk about this because this thing genuinely took forever to build.
First theres push-to-talk. u hold the mic button, talk, release, nero processes it. simple right? but then theres continuous mode and in continuous mode is where the chaos begins. When u flip that toggle nero spins up a SECOND speech recognizer in the background that is constantly listening for “hey nero”. like constantly. and when it hears it, it kills that background recognizer and spins up the MAIN recognizer to actually capture what ure saying. TWO recognizers running at the same time. One listening for the trigger, one ready to capture the actual message. the moment the wake word hits, background one dies, main one takes over.
About the STT, so originally this thing was using the Web Speech API and bruhhhh the Web Speech API is just unreliable as hell. it only works in Chrome, needs HTTPS or localhost, and half the time it just doesnt fire on result at all. Like u speak, it says “listening…”, then nothing happens. No transcription, no response, nothing. I tried fixing it multiple times — started recognition immediately instead of waiting for mic permission, added error handling, changed the flow… still broken. the Web Speech API is just built different (bad different), so i had to rip it out of nero and then replaced it with MediaRecorder + Gemini for transcription. Now when u tap the orb it records audio using the MediaRecorder API, sends the audio blob to Gemini, and Gemini transcribes it. And tbh its way more reliable because it doesnt depend on browser-specific speech engines. It just works better and the Gemini model used for transcription is gemini-2.5-flash — the same one used for chats so it understands context.
And heres the thing — after the addition of the STT the whole sound system changed. LIke before nero’s voice was legit too boring but now she is even able to speak like a waifu. She says hehehe and chuckles and speaks a lot better than before.
Also there was a lot of problem for the api keys, cause when anyone was trying to put their api in Nero it was getting stored but nero was unable to run on that api, due to which no one could use that and i also cannot put my gemini api cause it would get rate limit too quick if multiple people used it. So in settings there’s an “Add API Key” button that expands into a form and in that u give it a name (like “My Gemini Key”)and then paste your API key, hit add. Then key get VALIDATED before its stored — nero actually makes a test request to the API to confirm the key works. If the key is invalid it tells u immediately, doesn’t just silently store garbage🥀🥀.
Honestly the most impressive thing is that this runs on FREE APIs. The whole point is accessibility like gemini alone gets u pretty far for free , openrouter has free models and groq too has a free tier. Cerebras has a free tier and if u DO have paid keys then insert them in nero so she would use them instead. Its the best of both worlds..