# kyubyong/dc_tts architecture

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

- Interactive diagram: https://gitdiagram.com/kyubyong/dc_tts
- Repository: https://github.com/kyubyong/dc_tts

## Overview

This repository implements DC-TTS, a TensorFlow text-to-speech system. The main workflow prepares speech and transcript data, trains Text2Mel and SSRN as separate stages, then synthesizes new text into audio using the trained models. The graph also shows spectrogram processing and shared neural-network primitives. Relationships are grounded in the supplied source excerpts or README; unsampled implementation details are omitted.

Main entry points: [`train.py`](https://github.com/kyubyong/dc_tts/blob/master/train.py) (Training graph), [`synthesize.py`](https://github.com/kyubyong/dc_tts/blob/master/synthesize.py) (Synthesis runner), [`prepo.py`](https://github.com/kyubyong/dc_tts/blob/master/prepo.py) (Spectrogram preprocessing), [`data_load.py`](https://github.com/kyubyong/dc_tts/blob/master/data_load.py) (Text and batches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_data_loader["Text and batches<br/>[data_load.py]"]
  node_preprocess["Spectrogram preprocessing<br/>[prepo.py]"]
end

subgraph group_model["Model architecture"]
  node_text2mel["Text2Mel<br/>[networks.py]"]
  node_ssrn["SSRN<br/>[networks.py]"]
  node_neural_primitives["Neural primitives<br/>[modules.py]"]
end

subgraph group_runtime["Training and synthesis"]
  node_parameters["Model parameters<br/>[hyperparams.py]"]
  node_train_driver["Training graph<br/>[train.py]"]
  node_synthesis["Synthesis runner<br/>[synthesize.py]"]
end

subgraph group_audio["Audio processing"]
  node_audio_features["Spectrogram features<br/>[utils.py]"]
  node_audio_reconstruction["Waveform reconstruction<br/>[utils.py]"]
end

node_engineer(("TTS user"))
node_speech_corpus[("Speech corpus")]
node_test_text["Test sentences"]

node_engineer -->|"prepares data"| node_preprocess
node_speech_corpus -.->|"provides audio"| node_preprocess
node_preprocess -->|"loads transcripts"| node_data_loader
node_preprocess -->|"extracts features"| node_audio_features
node_engineer -->|"starts training"| node_train_driver
node_train_driver -->|"loads batches"| node_data_loader
node_train_driver -->|"builds stage one"| node_text2mel
node_train_driver -->|"builds stage two"| node_ssrn
node_text2mel -->|"uses layers"| node_neural_primitives
node_ssrn -->|"uses layers"| node_neural_primitives
node_train_driver -->|"reads settings"| node_parameters
node_engineer -->|"requests synthesis"| node_synthesis
node_synthesis -->|"loads test text"| node_data_loader
node_test_text -->|"supplies sentences"| node_synthesis
node_synthesis -->|"builds inference graph"| node_train_driver
node_synthesis -->|"reconstructs audio"| node_audio_reconstruction
node_audio_features -.->|"supports inversion"| node_audio_reconstruction

click node_data_loader "https://github.com/kyubyong/dc_tts/blob/master/data_load.py"
click node_preprocess "https://github.com/kyubyong/dc_tts/blob/master/prepo.py"
click node_parameters "https://github.com/kyubyong/dc_tts/blob/master/hyperparams.py"
click node_train_driver "https://github.com/kyubyong/dc_tts/blob/master/train.py"
click node_text2mel "https://github.com/kyubyong/dc_tts/blob/master/networks.py"
click node_ssrn "https://github.com/kyubyong/dc_tts/blob/master/networks.py"
click node_neural_primitives "https://github.com/kyubyong/dc_tts/blob/master/modules.py"
click node_synthesis "https://github.com/kyubyong/dc_tts/blob/master/synthesize.py"
click node_audio_features "https://github.com/kyubyong/dc_tts/blob/master/utils.py"
click node_audio_reconstruction "https://github.com/kyubyong/dc_tts/blob/master/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_data_loader,node_preprocess,node_engineer toneBlue
class node_text2mel,node_ssrn,node_neural_primitives,node_speech_corpus toneAmber
class node_parameters,node_train_driver,node_synthesis toneMint
class node_audio_features,node_audio_reconstruction toneRose
class node_test_text toneIndigo
```

## Components

### Data preparation

- [Text and batches](https://github.com/kyubyong/dc_tts/blob/master/data_load.py): `data_load.py`
- [Spectrogram preprocessing](https://github.com/kyubyong/dc_tts/blob/master/prepo.py): `prepo.py`

### Model architecture

- [Text2Mel](https://github.com/kyubyong/dc_tts/blob/master/networks.py): `networks.py`
- [SSRN](https://github.com/kyubyong/dc_tts/blob/master/networks.py): `networks.py`
- [Neural primitives](https://github.com/kyubyong/dc_tts/blob/master/modules.py): `modules.py`

### Training and synthesis

- [Model parameters](https://github.com/kyubyong/dc_tts/blob/master/hyperparams.py): `hyperparams.py`
- [Training graph](https://github.com/kyubyong/dc_tts/blob/master/train.py): `train.py`
- [Synthesis runner](https://github.com/kyubyong/dc_tts/blob/master/synthesize.py): `synthesize.py`

### Audio processing

- [Spectrogram features](https://github.com/kyubyong/dc_tts/blob/master/utils.py): `utils.py`
- [Waveform reconstruction](https://github.com/kyubyong/dc_tts/blob/master/utils.py): `utils.py`

### Other components

- **TTS user**
- **Speech corpus**
- **Test sentences**

## Connections

- TTS user → Spectrogram preprocessing: prepares data (evidence: `README.md`)
- Speech corpus → Spectrogram preprocessing: provides audio
- Spectrogram preprocessing → Text and batches: loads transcripts (evidence: `prepo.py`)
- Spectrogram preprocessing → Spectrogram features: extracts features (evidence: `prepo.py`)
- TTS user → Training graph: starts training (evidence: `README.md`)
- Training graph → Text and batches: loads batches (evidence: `train.py`)
- Training graph → Text2Mel: builds stage one (evidence: `train.py`)
- Training graph → SSRN: builds stage two (evidence: `train.py`)
- Text2Mel → Neural primitives: uses layers (evidence: `networks.py`)
- SSRN → Neural primitives: uses layers (evidence: `networks.py`)
- Training graph → Model parameters: reads settings (evidence: `train.py`)
- TTS user → Synthesis runner: requests synthesis (evidence: `README.md`)
- Synthesis runner → Text and batches: loads test text (evidence: `synthesize.py`)
- Test sentences → Synthesis runner: supplies sentences (evidence: `README.md`)
- Synthesis runner → Training graph: builds inference graph (evidence: `synthesize.py`)
- Synthesis runner → Waveform reconstruction: reconstructs audio (evidence: `synthesize.py`)
- Spectrogram features → Waveform reconstruction: supports inversion (evidence: `utils.py`)
