How angevox/angevoice works
AngeVoice is a self-hosted Chinese text-to-speech service. Its main workflow accepts text through HTTP or WebSocket, validates and prepares it, dispatches synthesis to a selected model, and returns encoded audio or streamed chunks. The README also documents Studio, batch ZIP output, voice profiles, model management, and service status/administration. Several route and subsystem implementations were not sampled, so uncertain internal links are omitted; dashed links indicate unverified wiring.
Main entry points: server.py FastAPI server · synthesis_service.py Synthesis service · streaming_service.py Streaming service · registry.py Engine registry
Components 23
Service interfaces
- FastAPI server
src/kokoro_tts/server.py - HTTP routes
src/kokoro_tts/routes/audio.py - WebSocket routes
src/kokoro_tts/routes/ws.py - Stream session
src/kokoro_tts/ws/session.py
Speech processing
- Synthesis service
src/kokoro_tts/services/synthesis_service.py - Streaming service
src/kokoro_tts/services/streaming_service.py - Request validation
src/kokoro_tts/validation.py - Chinese text frontend
src/kokoro_tts/text/frontend.py - Text segmenter
src/kokoro_tts/text_segmenter.py - Audio encoding
src/kokoro_tts/audio.py - Voice profiles
src/kokoro_tts/services/voice_profile_service.py
Model runtime
- Model lifecycle
src/kokoro_tts/engine_manager.py - Engine registry
src/kokoro_tts/engines/registry.py - Kokoro engine
src/kokoro_tts/engine.py - MOSS engine
src/kokoro_tts/moss_engine.py - ZipVoice engine
src/kokoro_tts/zipvoice/engine.py - Isolated workers
src/kokoro_tts/workers/process_worker.py
Operations and security
- Service state
src/kokoro_tts/service_state.py - Admin and status
src/kokoro_tts/routes/admin.py - API security
src/kokoro_tts/security.py
Studio and integrations
- Studio interface
src/kokoro_tts/static/app.js - Xiaozhi adapters
xiaozhi/adapters/angevoice.py
Other components
- User or client
Connections 27
- User or client → FastAPI server: sends requests
README.md - FastAPI server → HTTP routes: registers routes
src/kokoro_tts/server.py - FastAPI server → WebSocket routes: registers routes
src/kokoro_tts/server.py - HTTP routes → Synthesis service: dispatches synthesis
- WebSocket routes → Stream session: handles sessions
- Stream session → Streaming service: requests streaming
src/kokoro_tts/ws/session.py - Synthesis service → Request validation: validates input
src/kokoro_tts/services/synthesis_service.py - Streaming service → Request validation: validates input
src/kokoro_tts/services/streaming_service.py - Synthesis service → Chinese text frontend: prepares text
src/kokoro_tts/services/synthesis_service.py - Streaming service → Chinese text frontend: prepares text
src/kokoro_tts/services/streaming_service.py - Chinese text frontend → Text segmenter: segments text
src/kokoro_tts/text/frontend.py - Synthesis service → Service state: uses runtime state
src/kokoro_tts/services/synthesis_service.py - Streaming service → Service state: uses runtime state
src/kokoro_tts/services/streaming_service.py - Service state → Model lifecycle: manages models
src/kokoro_tts/service_state.py - Model lifecycle → Engine registry: resolves engines
src/kokoro_tts/engine_manager.py - Engine registry → Kokoro engine: creates engine
src/kokoro_tts/engines/registry.py - Engine registry → MOSS engine: creates engine
src/kokoro_tts/engines/registry.py - Engine registry → ZipVoice engine: creates engine
src/kokoro_tts/engines/registry.py - ZipVoice engine → Isolated workers: isolates inference
src/kokoro_tts/zipvoice/engine.py - Synthesis service → Audio encoding: encodes output
src/kokoro_tts/services/synthesis_service.py - Service state → Voice profiles: creates profile service
src/kokoro_tts/service_state.py - FastAPI server → Admin and status: registers routes
src/kokoro_tts/server.py - FastAPI server → API security: configures security
src/kokoro_tts/server.py - Studio interface → FastAPI server: calls API
- Xiaozhi adapters → FastAPI server: uses compatible API
- User or client → Studio interface: uses interface
README.md - User or client → Xiaozhi adapters: connects adapter
README.md