# pranabesh14/calltx architecture

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

- Interactive diagram: https://gitdiagram.com/pranabesh14/calltx
- Repository: https://github.com/pranabesh14/calltx

## Overview

calltx is an offline command-line call-recording transcriber. The user supplies audio files or folders and options; the program decodes and resamples audio, transcribes it, optionally detects speech gaps and separates stereo speakers, then writes timestamped transcripts. The excerpts show audio decoding and gap-analysis implementations and parts of the CLI orchestration, but not all output-writing or VAD control flow; README-backed links identify those capabilities without implying unshown calls.

Main entry points: [`src/main.cpp`](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp) (CLI and batch workflow), [`src/audio.cpp`](https://github.com/pranabesh14/calltx/blob/main/src/audio.cpp) (Decode and resample), [`src/deadair.cpp`](https://github.com/pranabesh14/calltx/blob/main/src/deadair.cpp) (Dead-air analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and audio"]
  node_recordings["Audio recordings"]
  node_cli["CLI and batch workflow<br/>[main.cpp]"]
  node_decoder["Decode and resample<br/>[audio.cpp]"]
  node_channel["Channel handling<br/>[main.cpp]"]
end

subgraph group_recognition["Speech recognition"]
  node_whisper["Whisper transcription<br/>[main.cpp]"]
  node_vad["Speech-region detection<br/>[main.cpp]"]
  node_segments["Timestamped segments<br/>[main.cpp]"]
end

subgraph group_analysis["Transcript analysis"]
  node_levels["Frame loudness<br/>[deadair.cpp]"]
  node_gapfinder["Dead-air analysis<br/>[deadair.cpp]"]
  node_gapmerge["Gap transcript entries<br/>[main.cpp]"]
end

subgraph group_output["Transcript output"]
  node_writers["TXT SRT JSON output<br/>[main.cpp]"]
  node_transcripts["Transcript files"]
end

node_user(("CLI user"))

node_user -->|"provides options"| node_cli
node_user -->|"selects recordings"| node_recordings
node_cli -->|"collects inputs"| node_recordings
node_cli -->|"loads audio"| node_decoder
node_decoder -->|"provides PCM channels"| node_channel
node_cli -->|"routes channels"| node_channel
node_cli -->|"transcribes audio"| node_whisper
node_cli -->|"optionally detects speech"| node_vad
node_whisper -->|"returns timed segments"| node_segments
node_decoder -->|"supplies PCM channels"| node_levels
node_vad -->|"supplies speech regions"| node_gapfinder
node_levels -->|"supplies loudness"| node_gapfinder
node_gapfinder -->|"returns classified gaps"| node_gapmerge
node_segments -->|"formats transcript data"| node_writers
node_gapmerge -->|"adds gap entries"| node_writers
node_writers -->|"writes files"| node_transcripts

click node_cli "https://github.com/pranabesh14/calltx/blob/main/src/main.cpp"
click node_decoder "https://github.com/pranabesh14/calltx/blob/main/src/audio.cpp"
click node_channel "https://github.com/pranabesh14/calltx/blob/main/src/main.cpp"
click node_whisper "https://github.com/pranabesh14/calltx/blob/main/src/main.cpp"
click node_vad "https://github.com/pranabesh14/calltx/blob/main/src/main.cpp"
click node_segments "https://github.com/pranabesh14/calltx/blob/main/src/main.cpp"
click node_levels "https://github.com/pranabesh14/calltx/blob/main/src/deadair.cpp"
click node_gapfinder "https://github.com/pranabesh14/calltx/blob/main/src/deadair.cpp"
click node_gapmerge "https://github.com/pranabesh14/calltx/blob/main/src/main.cpp"
click node_writers "https://github.com/pranabesh14/calltx/blob/main/src/main.cpp"

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_recordings,node_cli,node_decoder,node_channel,node_user toneBlue
class node_whisper,node_vad,node_segments toneAmber
class node_levels,node_gapfinder,node_gapmerge toneMint
class node_writers,node_transcripts toneRose
```

## Components

### Input and audio

- **Audio recordings**
- [CLI and batch workflow](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp): `src/main.cpp`
- [Decode and resample](https://github.com/pranabesh14/calltx/blob/main/src/audio.cpp): `src/audio.cpp`
- [Channel handling](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp): `src/main.cpp`

### Speech recognition

- [Whisper transcription](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp): `src/main.cpp`
- [Speech-region detection](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp): `src/main.cpp`
- [Timestamped segments](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp): `src/main.cpp`

### Transcript analysis

- [Frame loudness](https://github.com/pranabesh14/calltx/blob/main/src/deadair.cpp): `src/deadair.cpp`
- [Dead-air analysis](https://github.com/pranabesh14/calltx/blob/main/src/deadair.cpp): `src/deadair.cpp`
- [Gap transcript entries](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp): `src/main.cpp`

### Transcript output

- [TXT SRT JSON output](https://github.com/pranabesh14/calltx/blob/main/src/main.cpp): `src/main.cpp`
- **Transcript files**

### Other components

- **CLI user**

## Connections

- CLI user → CLI and batch workflow: provides options (evidence: `README.md`)
- CLI user → Audio recordings: selects recordings (evidence: `README.md`)
- CLI and batch workflow → Audio recordings: collects inputs (evidence: `src/main.cpp`)
- CLI and batch workflow → Decode and resample: loads audio (evidence: `README.md`)
- Decode and resample → Channel handling: provides PCM channels (evidence: `src/audio.cpp`)
- CLI and batch workflow → Channel handling: routes channels (evidence: `README.md`)
- CLI and batch workflow → Whisper transcription: transcribes audio (evidence: `src/main.cpp`)
- CLI and batch workflow → Speech-region detection: optionally detects speech (evidence: `README.md`)
- Whisper transcription → Timestamped segments: returns timed segments (evidence: `src/main.cpp`)
- Decode and resample → Frame loudness: supplies PCM channels (evidence: `src/deadair.cpp`)
- Speech-region detection → Dead-air analysis: supplies speech regions (evidence: `README.md`)
- Frame loudness → Dead-air analysis: supplies loudness (evidence: `src/deadair.cpp`)
- Dead-air analysis → Gap transcript entries: returns classified gaps (evidence: `src/main.cpp`)
- Timestamped segments → TXT SRT JSON output: formats transcript data (evidence: `README.md`)
- Gap transcript entries → TXT SRT JSON output: adds gap entries (evidence: `src/main.cpp`)
- TXT SRT JSON output → Transcript files: writes files (evidence: `README.md`)
