How ztp559/agent-test works
Main Components
a. Core Orchestrator
• Core.py / template.py / voice.py – entry point(s) coordinating the workflow
b. Audio I/O Layer
• voiceIO/record.py – captures microphone input
• voiceIO/play.py – plays synthesized audio
c. External API Wrappers (audioapi)
• s2t.py – sends recorded audio to STT service, parses transcripts
• smarttts.py – sends texts to TTS service, retrieves audio
• message_log.txt / send_log.txt – logging of requests/responses
d. Local Voice Clone Module (voiceclone)
• train.py – trains local voice models using getText.json
• tts.py – synthesizes speech locally from text
• .env / getText.json – configuration & training data
e. Configuration & Environment
• .env (root & submodules) – API keys, model parameters
• mcp.json – additional settings/config schema
• requirements.txt – dependency list
f. Legacy / Tests
• old/ – prior iterations of modules (reference only)
• test/ – (if populated) automated tests
Relationships & Data Flows
– User speaks into the microphone → voiceIO.record.py
– Recorded audio is handed to Core.py
– Core routes audio to either:
• audioapi.s2t.py → external STT → transcript
• (optionally) voiceclone.tts.py → local TTS (if using voice clone)
– Core processes the transcript, generates a response text (via template.py or business logic)
– Response text is sent to:
• audioapi.smarttts.py → external TTS → audio
• OR voiceclone.tts.py → local voice synthesis
– Synthesized audio is forwarded to voiceIO.play.py → speaker output
– All interactions log to audioapi/message_log.txt, send_log.txt
Architectural Patterns & Principles
– Layered Pipeline: separation between I/O, processing, and synthesis
– Adapter Pattern: audioapi and voiceclone modules abstract away external vs. local engines
– Config-driven: .env files and mcp.json centralize credentials and parameters
– Modular Design: easy to swap external TTS/STT for local voice clone
[ ] All major modules (voiceIO, audioapi, voiceclone, Core) represented
[ ] External cloud services depicted distinctly from local modules
[ ] Configuration stores (.env, mcp.json) drawn as data stores