- What STT (speech-to-text) and TTS (text-to-speech) are.
- Which open source tools to use in 2026 and why.
- Set up a complete voice assistant locally.
Key concepts
A voice assistant chains three pieces together:
- STT ( Speech To Text ): converts your speech into text.
- The language model (Ollama) thinks up the response.
- TTS ( Text To Speech ): converts the response into speech.
Because these are three pieces in a chain, total response time is the sum of all three: how long it takes to understand you, think, and speak. That's why each piece needs to be fast for the conversation to feel smooth.
Which tools to use (2026 edition)
The landscape has changed compared to previous years. Current recommendations:
Step by step
cd ~/proyectos-ia mkdir asistente-voz cd asistente-voz claude
A step-by-step example of what happens
Imagine you say "What's the weather tomorrow?" Internally, this happens in less than a couple of seconds:
- The ear (Moonshine) listens and writes: What's the weather tomorrow?
- That text goes to the brain (Ollama), which drafts a response.
- The response text goes to the mouth (Kokoro), which generates the audio.
- The browser plays that audio: you hear the answer.
Understanding this sequence helps you debug: if it doesn't understand you, the problem is in the ear; if the response is odd, in the brain; if there's no sound, in the mouth.
Run it on your computer
npm install npm run dev
Open the local address, press the microphone button, and say something.
If something goes wrong
- It doesn't pick up the microphone — check the browser permission and that the correct mic is selected.
- The voice sounds robotic or in another language — ask Claude Code for another Kokoro voice/language or try MagpieTTS.
- It's too slow — use a smaller language model; the voice itself is fast.
Practice challenge
Combine this chapter with the previous one: make it so you can ask your PDFs questions by voice and get spoken answers. You're combining two projects you already understand.