# arzelaascoli/lazysubs architecture

> Architecture diagram of the GitHub repository arzelaascoli/lazysubs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arzelaascoli/lazysubs
- Repository: https://github.com/arzelaascoli/lazysubs

## Overview

LazySubs is a Windows desktop app for streaming system, microphone, or single-window audio to Azure Speech Translation and displaying bilingual subtitles. The main workflow is source selection, capture, cloud recognition/translation, interim and final subtitle rendering, then session history. Separate branches cover Azure and language settings, and searching, copying, and exporting past sessions. The sampled code supports the capture and history responsibilities; some signal wiring and several UI details are omitted, so uncertain links are left out.

Main entry points: [`ui/record_page.py`](https://github.com/arzelaascoli/lazysubs/blob/main/ui/record_page.py) (Recording page), [`main.py`](https://github.com/arzelaascoli/lazysubs/blob/main/main.py) (App shell), [`core/engine_azure.py`](https://github.com/arzelaascoli/lazysubs/blob/main/core/engine_azure.py) (Azure translator), [`core/history_manager.py`](https://github.com/arzelaascoli/lazysubs/blob/main/core/history_manager.py) (History manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_main["App shell<br/>[main.py]"]
  node_home["Home page<br/>[home_page.py]"]
  node_record["Recording page<br/>[record_page.py]"]
  node_chat["Subtitle chat<br/>[chat_view.py]"]
end

subgraph group_capture["Audio capture"]
  node_audio["Audio capture<br/>[audio_capture.py]"]
  node_windows["Window sources<br/>[window_targets.py]"]
  node_process["Process loopback"]
end

subgraph group_translation["Live translation"]
  node_translator["Azure translator<br/>[engine_azure.py]"]
end

subgraph group_history["History"]
  node_historypage["History page<br/>[history_page.py]"]
  node_historymgr["History manager<br/>[history_manager.py]"]
  node_historyfiles["Session text files"]
end

subgraph group_settings["Settings and support"]
  node_settingspage["Settings page<br/>[settings_page.py]"]
  node_config["Config manager<br/>[config_manager.py]"]
  node_configfile["User config"]
  node_paths["App paths<br/>[app_paths.py]"]
  node_logger["System logger<br/>[logger.py]"]
  node_logfile["System log"]
end

node_user(("User"))
node_azure{{"Azure Speech"}}

node_user -->|"opens app"| node_main
node_main -->|"creates page"| node_home
node_main -->|"creates page"| node_record
node_main -->|"creates page"| node_historypage
node_main -->|"creates page"| node_settingspage
node_user -->|"selects and starts"| node_record
node_record -->|"selects source; starts capture"| node_audio
node_audio -->|"lists window sources"| node_windows
node_audio -->|"captures process audio"| node_process
node_audio -->|"streams audio chunks"| node_translator
node_translator -->|"streams audio; requests translation"| node_azure
node_azure -->|"returns recognition and translation"| node_translator
node_translator -->|"emits interim and final results"| node_record
node_record -->|"updates subtitles"| node_chat
node_record -->|"starts session; appends finals"| node_historymgr
node_historymgr -->|"writes and reads sessions"| node_historyfiles
node_user -->|"searches and exports"| node_historypage
node_historypage -->|"searches; reads; exports"| node_historymgr
node_user -->|"edits settings"| node_settingspage
node_settingspage -->|"loads and saves"| node_config
node_record -->|"reads translation settings"| node_config
node_config -->|"loads and writes"| node_configfile
node_config -->|"resolves config path"| node_paths
node_historymgr -->|"resolves history path"| node_paths
node_translator -->|"logs engine events"| node_logger
node_historymgr -->|"logs history events"| node_logger
node_settingspage -->|"opens log location"| node_logger
node_logger -->|"writes logs"| node_logfile

click node_main "https://github.com/arzelaascoli/lazysubs/blob/main/main.py"
click node_home "https://github.com/arzelaascoli/lazysubs/blob/main/ui/home_page.py"
click node_record "https://github.com/arzelaascoli/lazysubs/blob/main/ui/record_page.py"
click node_chat "https://github.com/arzelaascoli/lazysubs/blob/main/ui/chat_view.py"
click node_audio "https://github.com/arzelaascoli/lazysubs/blob/main/core/audio_capture.py"
click node_windows "https://github.com/arzelaascoli/lazysubs/blob/main/core/window_targets.py"
click node_process "https://github.com/arzelaascoli/lazysubs/blob/main/core/process_loopback.py"
click node_translator "https://github.com/arzelaascoli/lazysubs/blob/main/core/engine_azure.py"
click node_historypage "https://github.com/arzelaascoli/lazysubs/blob/main/ui/history_page.py"
click node_historymgr "https://github.com/arzelaascoli/lazysubs/blob/main/core/history_manager.py"
click node_settingspage "https://github.com/arzelaascoli/lazysubs/blob/main/ui/settings_page.py"
click node_config "https://github.com/arzelaascoli/lazysubs/blob/main/core/config_manager.py"
click node_paths "https://github.com/arzelaascoli/lazysubs/blob/main/core/app_paths.py"
click node_logger "https://github.com/arzelaascoli/lazysubs/blob/main/core/logger.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_home,node_record,node_chat,node_user toneBlue
class node_audio,node_windows,node_process toneAmber
class node_translator toneMint
class node_historypage,node_historymgr,node_historyfiles toneRose
class node_settingspage,node_config,node_configfile,node_paths,node_logger,node_logfile,node_azure toneIndigo
```

## Components

### Desktop app

- [App shell](https://github.com/arzelaascoli/lazysubs/blob/main/main.py): `main.py`
- [Home page](https://github.com/arzelaascoli/lazysubs/blob/main/ui/home_page.py): `ui/home_page.py`
- [Recording page](https://github.com/arzelaascoli/lazysubs/blob/main/ui/record_page.py): `ui/record_page.py`
- [Subtitle chat](https://github.com/arzelaascoli/lazysubs/blob/main/ui/chat_view.py): `ui/chat_view.py`

### Audio capture

- [Audio capture](https://github.com/arzelaascoli/lazysubs/blob/main/core/audio_capture.py): `core/audio_capture.py`
- [Window sources](https://github.com/arzelaascoli/lazysubs/blob/main/core/window_targets.py): `core/window_targets.py`
- [Process loopback](https://github.com/arzelaascoli/lazysubs/blob/main/core/process_loopback.py): `core/process_loopback.py`

### Live translation

- [Azure translator](https://github.com/arzelaascoli/lazysubs/blob/main/core/engine_azure.py): `core/engine_azure.py`

### History

- [History page](https://github.com/arzelaascoli/lazysubs/blob/main/ui/history_page.py): `ui/history_page.py`
- [History manager](https://github.com/arzelaascoli/lazysubs/blob/main/core/history_manager.py): `core/history_manager.py`
- **Session text files**

### Settings and support

- [Settings page](https://github.com/arzelaascoli/lazysubs/blob/main/ui/settings_page.py): `ui/settings_page.py`
- [Config manager](https://github.com/arzelaascoli/lazysubs/blob/main/core/config_manager.py): `core/config_manager.py`
- **User config**
- [App paths](https://github.com/arzelaascoli/lazysubs/blob/main/core/app_paths.py): `core/app_paths.py`
- [System logger](https://github.com/arzelaascoli/lazysubs/blob/main/core/logger.py): `core/logger.py`
- **System log**

### Other components

- **User**
- **Azure Speech**

## Connections

- User → App shell: opens app
- App shell → Home page: creates page
- App shell → Recording page: creates page
- App shell → History page: creates page
- App shell → Settings page: creates page
- User → Recording page: selects and starts
- Recording page → Audio capture: selects source; starts capture
- Audio capture → Window sources: lists window sources
- Audio capture → Process loopback: captures process audio
- Audio capture → Azure translator: streams audio chunks
- Azure translator → Azure Speech: streams audio; requests translation
- Azure Speech → Azure translator: returns recognition and translation
- Azure translator → Recording page: emits interim and final results
- Recording page → Subtitle chat: updates subtitles
- Recording page → History manager: starts session; appends finals
- History manager → Session text files: writes and reads sessions
- User → History page: searches and exports
- History page → History manager: searches; reads; exports
- User → Settings page: edits settings
- Settings page → Config manager: loads and saves
- Recording page → Config manager: reads translation settings
- Config manager → User config: loads and writes
- Config manager → App paths: resolves config path
- History manager → App paths: resolves history path
- Azure translator → System logger: logs engine events
- History manager → System logger: logs history events
- Settings page → System logger: opens log location
- System logger → System log: writes logs
