# gary542/voicestudio architecture

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

- Interactive diagram: https://gitdiagram.com/gary542/voicestudio
- Repository: https://github.com/gary542/voicestudio

## Overview

VoiceStudio is a local-first AI voice studio for cloning and designing voices, dubbing, dictation/transcription, and narration. The principal workflow is a user working in the desktop workspace, sending requests to the local backend, which routes speech tasks through model/runtime services and returns generated or processed media. Separate branches cover model setup and management, dubbing, and persistence. The README establishes product capabilities; source-index references and excerpts support only selected internal links, so other plausible connections are omitted rather than assumed.

Main entry points: [`backend/services/model_manager.py`](https://github.com/gary542/voicestudio/blob/main/backend/services/model_manager.py) (Model manager), [`backend/main.py`](https://github.com/gary542/voicestudio/blob/main/backend/main.py) (Backend application), [`backend/api/routers/dub_core.py`](https://github.com/gary542/voicestudio/blob/main/backend/api/routers/dub_core.py) (Dubbing API), [`backend/services/dub_pipeline.py`](https://github.com/gary542/voicestudio/blob/main/backend/services/dub_pipeline.py) (Dubbing pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_workspace["Studio workspace<br/>[app.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_api["Backend API"]
  node_backend["Backend application<br/>[main.py]"]
  node_engine_api["Engine API<br/>[engines.py]"]
  node_dub_api["Dubbing API<br/>[dub_core.py]"]
  node_setup_api["Model setup API<br/>[models.py]"]
end

subgraph group_speech["Speech workflows"]
  node_dub_pipeline["Dubbing pipeline<br/>[dub_pipeline.py]"]
  node_tts["Speech synthesis<br/>[tts_backend.py]"]
  node_asr["Speech recognition<br/>[asr_backend.py]"]
  node_narration["Narration and batch<br/>[audiobook.py]"]
  node_dictation["Dictation"]
  node_translation["Translation<br/>[translator.py]"]
  node_audio_tools["Media processing<br/>[ffmpeg_utils.py]"]
end

subgraph group_runtime["Model runtime"]
  node_model_manager["Model manager<br/>[model_manager.py]"]
  node_engine_routing["Engine routing<br/>[engine_routing.py]"]
  node_device_caps["Device capabilities<br/>[device_caps.py]"]
  node_engine_process["OmniVoice engine<br/>[main.py]"]
end

subgraph group_state["State and setup"]
  node_catalogue["Model catalogue<br/>[models.py]"]
  node_database[("Application database<br/>[db.py]")]
  node_preferences["User preferences<br/>[prefs.py]"]
end

node_user(("Studio user"))

node_user -->|"uses"| node_workspace
node_workspace -.->|"requests"| node_api_client
node_api_client -.->|"calls API"| node_backend
node_backend -.->|"routes requests"| node_engine_api
node_backend -.->|"routes requests"| node_dub_api
node_backend -.->|"routes requests"| node_setup_api
node_dub_api -->|"delegates"| node_dub_pipeline
node_dub_api -->|"uses"| node_asr
node_dub_pipeline -->|"uses"| node_audio_tools
node_dub_pipeline -->|"accesses"| node_database
node_engine_api -->|"uses"| node_model_manager
node_setup_api -->|"provides"| node_catalogue
node_model_manager -->|"routes engines"| node_engine_routing
node_model_manager -->|"checks hardware"| node_device_caps
node_model_manager -->|"loads runtime"| node_engine_process
node_model_manager -.->|"supports synthesis"| node_tts
node_tts -.->|"returns speech"| node_user
node_asr -.->|"returns transcript"| node_user
node_user -->|"creates narration"| node_narration
node_user -->|"dictates"| node_dictation
node_user -->|"translates speech"| node_translation
node_preferences -.->|"configures choices"| node_engine_api

click node_workspace "https://github.com/gary542/voicestudio/blob/main/electron/src/renderer/src/app.tsx"
click node_api_client "https://github.com/gary542/voicestudio/blob/main/electron/src/shared/api/client.ts"
click node_backend "https://github.com/gary542/voicestudio/blob/main/backend/main.py"
click node_engine_api "https://github.com/gary542/voicestudio/blob/main/backend/api/routers/engines.py"
click node_dub_api "https://github.com/gary542/voicestudio/blob/main/backend/api/routers/dub_core.py"
click node_setup_api "https://github.com/gary542/voicestudio/blob/main/backend/api/routers/setup/models.py"
click node_dub_pipeline "https://github.com/gary542/voicestudio/blob/main/backend/services/dub_pipeline.py"
click node_tts "https://github.com/gary542/voicestudio/blob/main/backend/services/tts_backend.py"
click node_asr "https://github.com/gary542/voicestudio/blob/main/backend/services/asr_backend.py"
click node_narration "https://github.com/gary542/voicestudio/blob/main/backend/services/audiobook.py"
click node_dictation "https://github.com/gary542/voicestudio/blob/main/backend/services/sherpa_dictation.py"
click node_translation "https://github.com/gary542/voicestudio/blob/main/backend/services/translator.py"
click node_model_manager "https://github.com/gary542/voicestudio/blob/main/backend/services/model_manager.py"
click node_engine_routing "https://github.com/gary542/voicestudio/blob/main/backend/services/engine_routing.py"
click node_device_caps "https://github.com/gary542/voicestudio/blob/main/backend/core/device_caps.py"
click node_engine_process "https://github.com/gary542/voicestudio/blob/main/backend/engines/omnivoice_subprocess/main.py"
click node_catalogue "https://github.com/gary542/voicestudio/blob/main/backend/api/routers/setup/models.py"
click node_database "https://github.com/gary542/voicestudio/blob/main/backend/core/db.py"
click node_preferences "https://github.com/gary542/voicestudio/blob/main/backend/core/prefs.py"
click node_audio_tools "https://github.com/gary542/voicestudio/blob/main/backend/services/ffmpeg_utils.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_workspace,node_api_client,node_user toneBlue
class node_backend,node_engine_api,node_dub_api,node_setup_api toneAmber
class node_dub_pipeline,node_tts,node_asr,node_narration,node_dictation,node_translation,node_audio_tools toneMint
class node_model_manager,node_engine_routing,node_device_caps,node_engine_process toneRose
class node_catalogue,node_database,node_preferences toneIndigo
```

## Components

### Desktop experience

- [Studio workspace](https://github.com/gary542/voicestudio/blob/main/electron/src/renderer/src/app.tsx): `electron/src/renderer/src/app.tsx`
- [API client](https://github.com/gary542/voicestudio/blob/main/electron/src/shared/api/client.ts): `electron/src/shared/api/client.ts`

### Backend API

- [Backend application](https://github.com/gary542/voicestudio/blob/main/backend/main.py): `backend/main.py`
- [Engine API](https://github.com/gary542/voicestudio/blob/main/backend/api/routers/engines.py): `backend/api/routers/engines.py`
- [Dubbing API](https://github.com/gary542/voicestudio/blob/main/backend/api/routers/dub_core.py): `backend/api/routers/dub_core.py`
- [Model setup API](https://github.com/gary542/voicestudio/blob/main/backend/api/routers/setup/models.py): `backend/api/routers/setup/models.py`

### Speech workflows

- [Dubbing pipeline](https://github.com/gary542/voicestudio/blob/main/backend/services/dub_pipeline.py): `backend/services/dub_pipeline.py`
- [Speech synthesis](https://github.com/gary542/voicestudio/blob/main/backend/services/tts_backend.py): `backend/services/tts_backend.py`
- [Speech recognition](https://github.com/gary542/voicestudio/blob/main/backend/services/asr_backend.py): `backend/services/asr_backend.py`
- [Narration and batch](https://github.com/gary542/voicestudio/blob/main/backend/services/audiobook.py): `backend/services/audiobook.py`
- [Dictation](https://github.com/gary542/voicestudio/blob/main/backend/services/sherpa_dictation.py): `backend/services/sherpa_dictation.py`
- [Translation](https://github.com/gary542/voicestudio/blob/main/backend/services/translator.py): `backend/services/translator.py`
- [Media processing](https://github.com/gary542/voicestudio/blob/main/backend/services/ffmpeg_utils.py): `backend/services/ffmpeg_utils.py`

### Model runtime

- [Model manager](https://github.com/gary542/voicestudio/blob/main/backend/services/model_manager.py): `backend/services/model_manager.py`
- [Engine routing](https://github.com/gary542/voicestudio/blob/main/backend/services/engine_routing.py): `backend/services/engine_routing.py`
- [Device capabilities](https://github.com/gary542/voicestudio/blob/main/backend/core/device_caps.py): `backend/core/device_caps.py`
- [OmniVoice engine](https://github.com/gary542/voicestudio/blob/main/backend/engines/omnivoice_subprocess/main.py): `backend/engines/omnivoice_subprocess/main.py`

### State and setup

- [Model catalogue](https://github.com/gary542/voicestudio/blob/main/backend/api/routers/setup/models.py): `backend/api/routers/setup/models.py`
- [Application database](https://github.com/gary542/voicestudio/blob/main/backend/core/db.py): `backend/core/db.py`
- [User preferences](https://github.com/gary542/voicestudio/blob/main/backend/core/prefs.py): `backend/core/prefs.py`

### Other components

- **Studio user**

## Connections

- Studio user → Studio workspace: uses (evidence: `README.md`)
- Studio workspace → API client: requests
- API client → Backend application: calls API
- Backend application → Engine API: routes requests
- Backend application → Dubbing API: routes requests (evidence: `backend/main.py`)
- Backend application → Model setup API: routes requests
- Dubbing API → Dubbing pipeline: delegates (evidence: `backend/services/dub_pipeline.py`)
- Dubbing API → Speech recognition: uses (evidence: `backend/api/routers/dub_core.py`)
- Dubbing pipeline → Media processing: uses (evidence: `backend/services/dub_pipeline.py`)
- Dubbing pipeline → Application database: accesses (evidence: `backend/services/dub_pipeline.py`)
- Engine API → Model manager: uses (evidence: `backend/api/routers/engines.py`)
- Model setup API → Model catalogue: provides (evidence: `backend/api/routers/setup/models.py`)
- Model manager → Engine routing: routes engines (evidence: `backend/services/model_manager.py`)
- Model manager → Device capabilities: checks hardware (evidence: `backend/services/model_manager.py`)
- Model manager → OmniVoice engine: loads runtime (evidence: `backend/services/model_manager.py`)
- Model manager → Speech synthesis: supports synthesis (evidence: `backend/services/model_manager.py`)
- Speech synthesis → Studio user: returns speech
- Speech recognition → Studio user: returns transcript
- Studio user → Narration and batch: creates narration (evidence: `README.md`)
- Studio user → Dictation: dictates (evidence: `README.md`)
- Studio user → Translation: translates speech (evidence: `README.md`)
- User preferences → Engine API: configures choices (evidence: `backend/api/routers/engines.py`)
