๐Ÿค–

SatBot

Animated AI Voice Assistant

Voice in โ†’ AI thinks โ†’ voice out, with a face that talks back in real-time

Python Pygame SVG Face Gemini 1.5 Flash Deepgram STT Google TTS FastAPI Microservices
3
Microservices
60 FPS
Face Animation
Live
Mouth Sync

github.com/sidx007/SatBot

Overview

What is SatBot?

SatBot is a desktop voice assistant with an animated SVG face. Press Space to talk โ€” it transcribes your speech, generates an AI response via Gemini, speaks it back with Google TTS, and syncs the mouth animation to audio amplitude in real-time at 60 FPS.

Animated Face

SVG-based face rendered in Pygame. Mouth position (6 states) maps to real-time audio amplitude. Includes blink, blush, and speaking indicator animations.

Microservice Architecture

STT, LLM, and TTS each run as independent FastAPI services on separate ports. The main face client orchestrates them via HTTP. Auto health-monitoring with restart on failure.

Voice Pipeline

PyAudio captures mic at 22050Hz Float32 โ†’ WAV โ†’ Deepgram Google STT โ†’ Gemini 1.5 Flash โ†’ gTTS โ†’ WAV โ†’ Pygame playback.

Simple Usage

Run python kaira_launcher.py. Services auto-start. Press SPACE to speak, Q to quit.

Services

Microservice Layout

๐ŸŽค
STT Service
Port 8001

Receives audio, converts to WAV via pydub, returns transcribed text via Google Speech Recognition

๐Ÿง 
LLM Service
Port 8003

Gemini 1.5 Flash with conversation history. 150 token max. 0.7 temperature. Maintains context across turns.

๐Ÿ”Š
TTS Service
Port 8004

Google TTS (gTTS) โ†’ MP3 โ†’ WAV at 22050Hz stereo via pydub. Returns audio bytes for Pygame playback.

โ†‘ โ†“
speaking_face.py โ€” Main Client
Pygame window ยท Audio capture ยท SVG rendering ยท Mouth sync ยท HTTP calls to all 3 services
kaira_launcher.py โ€” orchestrates startup ยท health checks (10s interval) ยท graceful shutdown
Face Animation

Real-time mouth sync

Audio amplitude is normalized 0โ†’1 and mapped to one of 6 mouth SVG frames. Updated every frame at 60 FPS so the face lip-syncs naturally to generated speech.

Amplitude โ†’ Mouth State

0.0 โ€“ 0.1
๐Ÿ˜ Closed
0.1 โ€“ 0.3
๐Ÿ™‚ Slightly open
0.3 โ€“ 0.5
๐Ÿ˜ฎ Medium open
0.5 โ€“ 0.7
๐Ÿ˜ฒ Wide open
0.7 โ€“ 1.0
๐Ÿ—ฃ๏ธ Max open

SVG Asset Set

bg.svg โ€” base face outline
mouth [1-5].svg โ€” progressive mouth positions
eye open big.svg, eye close up/down.svg โ€” blink
blush.svg, meh.svg, speak C.svg โ€” expressions
Flow 1.json, Flow 2.json โ€” animation sequences