# farmtipco/subtitle-for-hearing-aid architecture

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

- Interactive diagram: https://gitdiagram.com/farmtipco/subtitle-for-hearing-aid
- Repository: https://github.com/farmtipco/subtitle-for-hearing-aid

## Overview

This is a small live speech-transcription script. It loads a Whisper model, captures microphone audio in short segments, writes each segment to a temporary WAV file, transcribes it, and prints nonempty text. The graph shows only behavior evidenced in voice.py; the README is empty, and the other listed files were not excerpted, so their roles and connections are unknown.

Main entry points: [`voice.py`](https://github.com/farmtipco/subtitle-for-hearing-aid/blob/main/voice.py) (Transcription loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_voice["Transcription loop<br/>[voice.py]"]
node_microphone["Microphone"]
node_recognizer["Speech recognizer"]
node_wav["Temporary WAV"]
node_whisper["Whisper model"]
node_console["Console output"]

node_user -->|"starts"| node_voice
node_voice -->|"opens"| node_microphone
node_voice -->|"records audio"| node_recognizer
node_voice -->|"writes audio"| node_wav
node_voice -->|"transcribes WAV"| node_whisper
node_voice -->|"prints text"| node_console

click node_voice "https://github.com/farmtipco/subtitle-for-hearing-aid/blob/main/voice.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_user toneBlue
class node_voice toneTeal
class node_microphone,node_recognizer,node_wav,node_whisper,node_console toneIndigo
```

## Components

### Other components

- **User**
- [Transcription loop](https://github.com/farmtipco/subtitle-for-hearing-aid/blob/main/voice.py): `voice.py`
- **Microphone**
- **Speech recognizer**
- **Temporary WAV**
- **Whisper model**
- **Console output**

## Connections

- User → Transcription loop: starts (evidence: `voice.py`)
- Transcription loop → Microphone: opens (evidence: `voice.py`)
- Transcription loop → Speech recognizer: records audio (evidence: `voice.py`)
- Transcription loop → Temporary WAV: writes audio (evidence: `voice.py`)
- Transcription loop → Whisper model: transcribes WAV (evidence: `voice.py`)
- Transcription loop → Console output: prints text (evidence: `voice.py`)
