How toplib/openatc works
OpenATC is an ATC communication-training simulator, not a general chatbot: the documented goal is to simulate procedures while AI handles natural-language interpretation and pilot responses. The principal runtime path captures speech, segments it with voice activity detection, transcribes it, validates/corrects the phrase, generates a pilot reply and speech-ready wording, then plays synthesized audio. The GUI exposes ATC and pilot modes plus model, settings, tutorial, and documentation pages, though several actions are placeholders. Edges follow the sampled pipeline and shell wiring; the README describes simulation intent but no separate scenario-simulation implementation is evidenced here.
Main entry points: AppShell.cpp Application Shell · MicrophonePipeline.cpp Microphone VAD · ATCPipeline.cpp ATC Orchestrator · Microphone.cpp Microphone Input
Components 23
Speech Capture
- Microphone VAD
src/core/pipeline/microphone/MicrophonePipeline.cpp - Microphone Input
src/core/microphone/Microphone.cpp - Audio Buffer
src/core/microphone/MicrophoneInputAudioData.h
ATC Conversation
- Speech Recognition
src/ai/stt/Whisper/WhisperBackend.cpp - ATC Orchestrator
src/core/pipeline/ATCPipeline.cpp - LLM Interface
src/ai/llm/ILLMBackend.h - Llama.cpp Backend
src/ai/llm/llamacpp/LlamacppBackend.cpp
Speech Output
- Speech Synthesis
src/ai/tts/SherpaOnnx/SherpaOnnxBackend.cpp - Audio Playback
src/core/audio/OpenAL/OpenALBackend.cpp
Application Interface
- GUI Startup
src/main.cpp - GUI Manager
src/gui/Manager.cpp - Home Window
src/gui/home/HomeWindow.h - Application Shell
src/gui/shell/AppShell.cpp - Activity Page
src/gui/pages/ActivityPage.cpp - Mode And Hub Pages
src/gui/pages/ContentPages.cpp - Settings Page
src/gui/pages/SettingsPage.cpp - Navigation Header
src/gui/widgets/AppHeader.cpp - Project Sidebar
src/gui/widgets/ProjectSidebar.cpp - Status Footer
src/gui/widgets/StatusFooter.h
Model Access
- Hugging Face Client
src/clients/huggingface/HuggingFace.cpp - HTTP Client
src/core/net/HttpClient.cpp
Other components
- Controller
- Pilot Voice
Connections 21
- Microphone VAD → Microphone Input: starts capture
src/core/pipeline/microphone/MicrophonePipeline.cpp - Microphone Input → Audio Buffer: buffers samples
- Audio Buffer → Microphone VAD: reads samples
src/core/pipeline/microphone/MicrophonePipeline.cpp - Microphone VAD → Speech Recognition: provides speech
- Controller → Microphone Input: speaks into
- Speech Recognition → ATC Orchestrator: transcribed text
- ATC Orchestrator → LLM Interface: requests responses
src/core/pipeline/ATCPipeline.cpp - LLM Interface → Llama.cpp Backend: implemented by
- ATC Orchestrator → Speech Synthesis: returns speech text
- Speech Synthesis → Audio Playback: sends audio
- Audio Playback → Pilot Voice: plays response
- GUI Startup → Home Window: creates window
src/main.cpp - Home Window → Application Shell: hosts shell
src/gui/home/HomeWindow.h - GUI Manager → Application Shell: routes settings
- Application Shell → Activity Page: registers page
src/gui/shell/AppShell.cpp - Application Shell → Mode And Hub Pages: registers pages
src/gui/shell/AppShell.cpp - Application Shell → Settings Page: registers page
src/gui/shell/AppShell.cpp - Application Shell → Navigation Header: connects navigation
src/gui/shell/AppShell.cpp - Application Shell → Project Sidebar: connects projects
src/gui/shell/AppShell.cpp - Application Shell → Status Footer: creates footer
src/gui/shell/AppShell.cpp - Hugging Face Client → HTTP Client: uses HTTP
src/clients/huggingface/HuggingFace.cpp