How sugarlabs/speak-ai works
SpeakAI is a Sugar desktop activity where users type text and see a configurable face speak it aloud. The main runtime path runs from the Sugar-launched activity through speech synthesis to audio playback; the face also renders speech-related animation. The activity additionally supports persona and face selection, chat, and AI response options. The repository includes both the Kokoro TTS implementation and AIML components. Some connections are based on SOURCE INDEX references rather than inspected call sites, so the graph omits uncertain links.
Main entry points: activity.py Activity UI and controls · face.py Face renderer · speech.py Speech playback · chat.py Chat interface
Components 27
Activity interface
- Activity UI and controls
activity.py - Chat interface
chat.py - Chat display
chatbox.py - Face and voice selection
faceselect.py - Photo face
photoface.py
Conversation and AI
- Remote LLM
LLM.py - Local GGUF inference
GenAI/gguf_inference.py - Profanity filtering
GenAI/profainity_check.py - Conversation logic
brain.py
Speech synthesis
- Speech playback
speech.py - Text-to-audio pipeline
kokoro/pipeline.py - Kokoro model
kokoro/model.py - Audio decoder
kokoro/istftnet.py
Face and animation
- Face renderer
face.py - Eye rendering
eye.py - Eyelashes
eyelashes.py - Mouth animation
mouth.py - FFT mouth animation
fft_mouth.py - Waveform mouth animation
waveform_mouth.py - Face accessories
glasses.py - Sleepy expression
sleepy.py - Wireframe eyes
wireframes.py
AIML runtime
- AIML interpreter
aiml/Kernel.py - AIML parser
aiml/AimlParser.py
Other components
- Sugar desktop
- User
- Audio output
Connections 27
- Sugar desktop → Activity UI and controls: launches
- User → Activity UI and controls: enters text
- Activity UI and controls → Speech playback: requests speech
activity.py - Speech playback → Text-to-audio pipeline: generates audio
speech.py - Text-to-audio pipeline → Kokoro model: uses model
kokoro/pipeline.py - Kokoro model → Audio decoder: decodes audio
kokoro/model.py - Speech playback → Audio output: plays audio
speech.py - Activity UI and controls → Face renderer: updates face
activity.py - Face renderer → Speech playback: reads speech state
face.py - Face renderer → Eye rendering: renders eyes
face.py - Face renderer → Eyelashes: renders lashes
face.py - Face renderer → Mouth animation: renders mouth
face.py - Face renderer → FFT mouth animation: renders mouth
face.py - Face renderer → Waveform mouth animation: renders mouth
face.py - Face renderer → Face accessories: renders accessory
face.py - Face renderer → Sleepy expression: renders expression
face.py - Face renderer → Wireframe eyes: renders eyes
face.py - Activity UI and controls → Face and voice selection: selects persona
activity.py - Activity UI and controls → Photo face: selects photo face
activity.py - Activity UI and controls → Chat interface: opens chat
activity.py - Chat interface → Chat display: renders messages
chat.py - Activity UI and controls → Remote LLM: requests answer
activity.py - Activity UI and controls → Profanity filtering: checks response
activity.py - Activity UI and controls → Local GGUF inference: uses inference
- Activity UI and controls → Conversation logic: uses conversation logic
activity.py - Conversation logic → AIML interpreter: queries interpreter
brain.py - AIML interpreter → AIML parser: parses AIML
aiml/Kernel.py