Happy, the AI hardware robot – talking – text to speech
These are the steps to set up the text to speech to text converter process for the Building Happy, the AI hardware robot project to hear Happy’s answer.
More details are in text-to-speech\README.md
Install Kokoro
- Open a PowerShell terminal and execute
py -3.12 -m pip install kokoro soundfile - Check if Kokoro is installed
py -3.12 -c “import kokoro, soundfile; print(‘kokoro ok’)”
Expected response: kokoro ok
Check the running servers
- In a PowerShell terminal execute
curl.exe http://localhost:8000/health
Example success result: {“ok”: true, “model”: “small”, “cuda”: true, “llm”: “google/gemma-4-26b-a4b-qat”, “voice”: “af_heart”}
Check Happy’s voice on the computer
- Open a PowerShell terminal where you can save files
cd $env:TEMP - Generate a short audio file and play it
'{"text":"Hello, I am Happy! Nice to meet you."}' | curl.exe -X POST http://localhost:8000/say -H "Content-Type: application/json" --data-binary "@-" -o say.wavstart say.wav - You should hear a female voice
Hear the AI generated answer on the PC
- This command with the “chat”: true option passess the prompt to Gemma, and we will hear the AI’s answer through the computer speakers
'{"text":"What is your favorite color?", "chat": true}' | curl.exe -X POST http://localhost:8000/say -H "Content-Type: application/json" --data-binary "@-" -o answer.wavstart answer.wav - You should hear a randomly generated real answer
Test the whole loop that the robot uses
We will use the /talk option
- Copy the test.waw file or any other audio file with speech into the folder where the PowerShell terminal is open
- Execute the command:
curl.exe -X POST -H "Content-Type: audio/wav" --data-binary "@test.wav" -D - -o reply.pcm http://localhost:8000/talk - The terminal should display the text transcription of the audio file and the robot and the answer of the AI model
Check the robot’s speaker
Test the amp and the speaker to make sure the electronic circuit is in working order
- Upload the firmware/tests/amp_test/amp_test.ino file to the ESP32 board with the Arduino IDE, as we did it during the audio test earlier
- You should hear the rising tone
Hear Happy speak
- Upload the speech-to-text/firmware/stt_client/stt_client.in file to the ESP32 board
- When you say the word “happy” the robot starts to listen and answers you.
- Within 8 seconds of her answer you don’t have to say “happy” again to continue the conversation, just keep talking to her.
- You should see Happy’s answer in the serial monitor and hear her in the robot’s speaker
If Happy does not answer
- Press and hold the BOOT button, ask a question and release the button
- You should see Happy’s answer in the serial monitor and hear her in the robot’s speaker
Troubleshooting
Issue
If the robot does not connect to the computer after computer restart
Reason
Most likely the IP address of the computer changed.
Solution
On your computer
Check Windows “random hardware addresses”. That setting makes the PC show a different MAC address to the router, so the reservation wouldn’t match.
- Go to Settings → Network & internet → Wi-Fi → Manage known networks → (your network)
- Set Random hardware addresses to Off.

In the Wi-Fi router
Turn on the IP address reservation in your Wi-Fi router settings.
Deco Mesh Network
- Open the Deco app
- Tap More in the bottom-right corner, then Advanced.
- Tap Address Reservation, then the + button.
- Choose your PC from the list. If it’s not listed, enter its MAC address by hand.
- Set the IP address and save.