Skip to content
Courses/Claude Code + Local AI/Chatbot that listens and speaks

Chatbot that listens and speaks

An assistant you talk to through the microphone and it answers out loud. All with local AI: speech recognition, brain, and synthetic voice, without sending your audio to any server. Ideal for accessibility, customer support, or hands-free use.

  • 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

Terminal
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

Terminal
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.

Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue