# msrbuilds/voice-studio architecture

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

- Interactive diagram: https://gitdiagram.com/msrbuilds/voice-studio
- Repository: https://github.com/msrbuilds/voice-studio

## Overview

Voice Studio is a local web application for speech generation and audio-to-audio workflows. Users choose a project mode and voice, then synthesize speech, transcribe audio, translate text, or dub a clip; generated audio and transcripts can be edited, cached, and exported. The backend coordinates selectable TTS engines, ASR, translation, voice management, and model lifecycle operations. The README documents the major modes and capabilities; some subsystem connections are therefore documented rather than verified from sampled implementation.

Main entry points: [`backend/app.py`](https://github.com/msrbuilds/voice-studio/blob/main/backend/app.py) (Application and routing), [`backend/services/synthesize.py`](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/synthesize.py) (Synthesis orchestration), [`backend/services/dub.py`](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/dub.py) (Dub orchestration), [`backend/services/transcribe.py`](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/transcribe.py) (Transcription service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Studio UI"]
  node_app_ui["Project workspace<br/>[App.tsx]"]
  node_mode_editors["Mode editors"]
  node_engine_ui["Engine selector<br/>[EngineSelector.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["HTTP API"]
  node_fastapi["Application and routing<br/>[app.py]"]
  node_synth_api["Synthesis and streaming routes"]
  node_asr_api["ASR and transcription routes<br/>[asr.py]"]
  node_dub_api["Dubbing route<br/>[dub.py]"]
  node_translate_api["Translation route<br/>[translate.py]"]
  node_engine_api["Engine management routes<br/>[engines.py]"]
  node_voice_api["Voice routes<br/>[voices.py]"]
end

subgraph group_speech["Speech workflows"]
  node_transcribe["Transcription service<br/>[transcribe.py]"]
  node_whisper["Whisper ASR<br/>[whisper_engine.py]"]
  node_dub["Dub orchestration<br/>[dub.py]"]
  node_translation["Offline translation<br/>[translate.py]"]
  node_synthesis["Synthesis orchestration<br/>[synthesize.py]"]
end

subgraph group_models["Models and voices"]
  node_engine_manager["Engine manager<br/>[engine_manager.py]"]
  node_tts_engines["TTS engine implementations"]
  node_voice_registry["Voice registry<br/>[voices.py]"]
  node_model_ops["Model lifecycle"]
end

subgraph group_state["Caches and services"]
  node_synth_cache[("Synthesis cache<br/>[synth_cache.py]")]
  node_other_caches[("Workflow caches")]
  node_gpu_gate["GPU execution gate<br/>[gpu_gate.py]"]
end

node_user(("Local user"))
node_audio_files["Local audio files"]

node_user -->|"uses"| node_app_ui
node_app_ui -->|"renders"| node_mode_editors
node_app_ui -.->|"requests"| node_api_client
node_engine_ui -.->|"requests"| node_api_client
node_api_client -.->|"calls API"| node_fastapi
node_fastapi -->|"registers routes"| node_synth_api
node_fastapi -->|"registers routes"| node_asr_api
node_fastapi -->|"registers routes"| node_dub_api
node_fastapi -->|"registers routes"| node_translate_api
node_fastapi -->|"registers routes"| node_engine_api
node_fastapi -->|"registers routes"| node_voice_api
node_synth_api -->|"delegates to"| node_synthesis
node_asr_api -->|"delegates to"| node_transcribe
node_transcribe -.->|"transcribes with"| node_whisper
node_dub_api -->|"delegates to"| node_dub
node_dub -.->|"transcribes via"| node_transcribe
node_dub -.->|"translates via"| node_translation
node_dub -.->|"synthesizes via"| node_synthesis
node_translate_api -.->|"delegates to"| node_translation
node_engine_api -->|"manages engines"| node_engine_manager
node_engine_api -->|"starts lifecycle tasks"| node_model_ops
node_voice_api -.->|"manages voices"| node_voice_registry
node_synthesis -->|"selects engine"| node_engine_manager
node_engine_manager -->|"constructs engines"| node_tts_engines
node_synthesis -->|"resolves voice"| node_voice_registry
node_synthesis -->|"reads and writes"| node_synth_cache
node_synthesis -->|"runs inference through"| node_gpu_gate
node_transcribe -.->|"serializes inference"| node_gpu_gate
node_dub -.->|"uses workflow caches"| node_other_caches
node_audio_files -.->|"uploads audio"| node_asr_api
node_audio_files -.->|"uploads audio"| node_dub_api

click node_app_ui "https://github.com/msrbuilds/voice-studio/blob/main/frontend/src/App.tsx"
click node_mode_editors "https://github.com/msrbuilds/voice-studio/tree/main/frontend/src/components"
click node_engine_ui "https://github.com/msrbuilds/voice-studio/blob/main/frontend/src/components/EngineSelector.tsx"
click node_api_client "https://github.com/msrbuilds/voice-studio/blob/main/frontend/src/lib/api.ts"
click node_fastapi "https://github.com/msrbuilds/voice-studio/blob/main/backend/app.py"
click node_synth_api "https://github.com/msrbuilds/voice-studio/tree/main/backend/api"
click node_asr_api "https://github.com/msrbuilds/voice-studio/blob/main/backend/api/asr.py"
click node_dub_api "https://github.com/msrbuilds/voice-studio/blob/main/backend/api/dub.py"
click node_translate_api "https://github.com/msrbuilds/voice-studio/blob/main/backend/api/translate.py"
click node_engine_api "https://github.com/msrbuilds/voice-studio/blob/main/backend/api/engines.py"
click node_voice_api "https://github.com/msrbuilds/voice-studio/blob/main/backend/api/voices.py"
click node_transcribe "https://github.com/msrbuilds/voice-studio/blob/main/backend/services/transcribe.py"
click node_whisper "https://github.com/msrbuilds/voice-studio/blob/main/backend/core/asr/whisper_engine.py"
click node_dub "https://github.com/msrbuilds/voice-studio/blob/main/backend/services/dub.py"
click node_translation "https://github.com/msrbuilds/voice-studio/blob/main/backend/services/translate.py"
click node_synthesis "https://github.com/msrbuilds/voice-studio/blob/main/backend/services/synthesize.py"
click node_engine_manager "https://github.com/msrbuilds/voice-studio/blob/main/backend/core/engine_manager.py"
click node_tts_engines "https://github.com/msrbuilds/voice-studio/tree/main/backend/core/engines"
click node_voice_registry "https://github.com/msrbuilds/voice-studio/blob/main/backend/services/voices.py"
click node_model_ops "https://github.com/msrbuilds/voice-studio/tree/main/backend/services"
click node_synth_cache "https://github.com/msrbuilds/voice-studio/blob/main/backend/services/synth_cache.py"
click node_other_caches "https://github.com/msrbuilds/voice-studio/tree/main/backend/services"
click node_gpu_gate "https://github.com/msrbuilds/voice-studio/blob/main/backend/core/gpu_gate.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_app_ui,node_mode_editors,node_engine_ui,node_api_client,node_user toneBlue
class node_fastapi,node_synth_api,node_asr_api,node_dub_api,node_translate_api,node_engine_api,node_voice_api toneAmber
class node_transcribe,node_whisper,node_dub,node_translation,node_synthesis toneMint
class node_engine_manager,node_tts_engines,node_voice_registry,node_model_ops toneRose
class node_synth_cache,node_other_caches,node_gpu_gate,node_audio_files toneIndigo
```

## Components

### Studio UI

- [Project workspace](https://github.com/msrbuilds/voice-studio/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Mode editors](https://github.com/msrbuilds/voice-studio/tree/main/frontend/src/components): `frontend/src/components`
- [Engine selector](https://github.com/msrbuilds/voice-studio/blob/main/frontend/src/components/EngineSelector.tsx): `frontend/src/components/EngineSelector.tsx`
- [API client](https://github.com/msrbuilds/voice-studio/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### HTTP API

- [Application and routing](https://github.com/msrbuilds/voice-studio/blob/main/backend/app.py): `backend/app.py`
- [Synthesis and streaming routes](https://github.com/msrbuilds/voice-studio/tree/main/backend/api): `backend/api`
- [ASR and transcription routes](https://github.com/msrbuilds/voice-studio/blob/main/backend/api/asr.py): `backend/api/asr.py`
- [Dubbing route](https://github.com/msrbuilds/voice-studio/blob/main/backend/api/dub.py): `backend/api/dub.py`
- [Translation route](https://github.com/msrbuilds/voice-studio/blob/main/backend/api/translate.py): `backend/api/translate.py`
- [Engine management routes](https://github.com/msrbuilds/voice-studio/blob/main/backend/api/engines.py): `backend/api/engines.py`
- [Voice routes](https://github.com/msrbuilds/voice-studio/blob/main/backend/api/voices.py): `backend/api/voices.py`

### Speech workflows

- [Transcription service](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/transcribe.py): `backend/services/transcribe.py`
- [Whisper ASR](https://github.com/msrbuilds/voice-studio/blob/main/backend/core/asr/whisper_engine.py): `backend/core/asr/whisper_engine.py`
- [Dub orchestration](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/dub.py): `backend/services/dub.py`
- [Offline translation](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/translate.py): `backend/services/translate.py`
- [Synthesis orchestration](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/synthesize.py): `backend/services/synthesize.py`

### Models and voices

- [Engine manager](https://github.com/msrbuilds/voice-studio/blob/main/backend/core/engine_manager.py): `backend/core/engine_manager.py`
- [TTS engine implementations](https://github.com/msrbuilds/voice-studio/tree/main/backend/core/engines): `backend/core/engines`
- [Voice registry](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/voices.py): `backend/services/voices.py`
- [Model lifecycle](https://github.com/msrbuilds/voice-studio/tree/main/backend/services): `backend/services`

### Caches and services

- [Synthesis cache](https://github.com/msrbuilds/voice-studio/blob/main/backend/services/synth_cache.py): `backend/services/synth_cache.py`
- [Workflow caches](https://github.com/msrbuilds/voice-studio/tree/main/backend/services): `backend/services`
- [GPU execution gate](https://github.com/msrbuilds/voice-studio/blob/main/backend/core/gpu_gate.py): `backend/core/gpu_gate.py`

### Other components

- **Local user**
- **Local audio files**

## Connections

- Local user → Project workspace: uses
- Project workspace → Mode editors: renders (evidence: `frontend/src/App.tsx`)
- Project workspace → API client: requests
- Engine selector → API client: requests
- API client → Application and routing: calls API
- Application and routing → Synthesis and streaming routes: registers routes (evidence: `backend/app.py`)
- Application and routing → ASR and transcription routes: registers routes (evidence: `backend/app.py`)
- Application and routing → Dubbing route: registers routes (evidence: `backend/app.py`)
- Application and routing → Translation route: registers routes (evidence: `backend/app.py`)
- Application and routing → Engine management routes: registers routes (evidence: `backend/app.py`)
- Application and routing → Voice routes: registers routes (evidence: `backend/app.py`)
- Synthesis and streaming routes → Synthesis orchestration: delegates to (evidence: `backend/api/deps.py`)
- ASR and transcription routes → Transcription service: delegates to (evidence: `backend/api/asr.py`)
- Transcription service → Whisper ASR: transcribes with
- Dubbing route → Dub orchestration: delegates to (evidence: `backend/api/dub.py`)
- Dub orchestration → Transcription service: transcribes via
- Dub orchestration → Offline translation: translates via
- Dub orchestration → Synthesis orchestration: synthesizes via
- Translation route → Offline translation: delegates to
- Engine management routes → Engine manager: manages engines (evidence: `backend/api/engines.py`)
- Engine management routes → Model lifecycle: starts lifecycle tasks (evidence: `backend/api/engines.py`)
- Voice routes → Voice registry: manages voices
- Synthesis orchestration → Engine manager: selects engine (evidence: `backend/services/synthesize.py`)
- Engine manager → TTS engine implementations: constructs engines (evidence: `backend/core/engine_manager.py`)
- Synthesis orchestration → Voice registry: resolves voice (evidence: `backend/services/synthesize.py`)
- Synthesis orchestration → Synthesis cache: reads and writes (evidence: `backend/services/synthesize.py`)
- Synthesis orchestration → GPU execution gate: runs inference through (evidence: `backend/services/synthesize.py`)
- Transcription service → GPU execution gate: serializes inference
- Dub orchestration → Workflow caches: uses workflow caches
- Local audio files → ASR and transcription routes: uploads audio
- Local audio files → Dubbing route: uploads audio
