# balasubramanyam-chilukala/voicegym architecture

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

- Interactive diagram: https://gitdiagram.com/balasubramanyam-chilukala/voicegym
- Repository: https://github.com/balasubramanyam-chilukala/voicegym

## Overview

VoiceGym is a webcam-based fitness coaching application. A user selects a voice coach, exercises in view of the camera, and receives exercise detection, form analysis, repetition tracking, and spoken feedback; workout results can be saved and used for progress, achievements, and community features. The single runtime file contains the sampled detector, form analyzer, feedback, audio, database, and session responsibilities. The README documents additional capabilities and their high-level relationships; unsampled implementation details are not inferred.

Main entry points: [`voicegym.py`](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py) (Session manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workout["Workout coaching"]
  node_coach_select["Voice selection<br/>[voicegym.py]"]
  node_pose["Pose detection<br/>[voicegym.py]"]
  node_exercise["Exercise detection<br/>[voicegym.py]"]
  node_form["Form analysis<br/>[voicegym.py]"]
  node_rep["Rep counting<br/>[voicegym.py]"]
  node_session["Session manager<br/>[voicegym.py]"]
end

subgraph group_feedback["Coaching output"]
  node_feedback["AI feedback<br/>[voicegym.py]"]
  node_translation["Translation<br/>[voicegym.py]"]
  node_tts["Speech generation<br/>[voicegym.py]"]
  node_playback["Audio playback<br/>[voicegym.py]"]
end

subgraph group_progress["Progress and community"]
  node_db_manager[("Workout database<br/>[voicegym.py]")]
  node_progress_ui["Progress analytics<br/>[voicegym.py]"]
  node_achievements["Achievements<br/>[voicegym.py]"]
  node_challenges["Global challenges<br/>[voicegym.py]"]
  node_social["Social features<br/>[voicegym.py]"]
end

subgraph group_external["External systems"]
  node_camera["Camera input"]
  node_gemini["Gemini AI"]
  node_murf["Murf TTS"]
  node_audio_out["Audio output"]
end

node_user(("User"))

node_user -->|"selects coach"| node_coach_select
node_camera -->|"provides frames"| node_pose
node_pose -->|"provides landmarks"| node_exercise
node_exercise -->|"identifies exercise"| node_session
node_form -->|"provides analysis"| node_session
node_rep -->|"tracks repetitions"| node_session
node_session -->|"requests coaching"| node_feedback
node_feedback -->|"requests feedback"| node_gemini
node_feedback -->|"prepares speech text"| node_translation
node_translation -->|"passes translated text"| node_tts
node_tts -->|"requests speech"| node_murf
node_tts -->|"provides audio"| node_playback
node_playback -->|"plays speech"| node_audio_out
node_session -->|"saves workouts"| node_db_manager
node_db_manager -->|"supplies workout data"| node_progress_ui
node_db_manager -->|"tracks milestones"| node_achievements
node_db_manager -->|"records contributions"| node_challenges
node_db_manager -->|"supports community features"| node_social
node_session -->|"gets or creates user"| node_db_manager
node_session -->|"announces unlocks"| node_achievements

click node_coach_select "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_pose "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_exercise "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_form "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_rep "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_session "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_feedback "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_translation "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_tts "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_playback "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_db_manager "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_progress_ui "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_achievements "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_challenges "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py"
click node_social "https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.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_coach_select,node_pose,node_exercise,node_form,node_rep,node_session,node_user toneBlue
class node_feedback,node_translation,node_tts,node_playback toneAmber
class node_db_manager,node_progress_ui,node_achievements,node_challenges,node_social toneMint
class node_camera,node_gemini,node_murf,node_audio_out toneRose
```

## Components

### Workout coaching

- [Voice selection](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Pose detection](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Exercise detection](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Form analysis](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Rep counting](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Session manager](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`

### Coaching output

- [AI feedback](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Translation](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Speech generation](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Audio playback](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`

### Progress and community

- [Workout database](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Progress analytics](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Achievements](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Global challenges](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`
- [Social features](https://github.com/balasubramanyam-chilukala/voicegym/blob/main/voicegym.py): `voicegym.py`

### External systems

- **Camera input**
- **Gemini AI**
- **Murf TTS**
- **Audio output**

### Other components

- **User**

## Connections

- User → Voice selection: selects coach (evidence: `README.md`)
- Camera input → Pose detection: provides frames (evidence: `README.md`)
- Pose detection → Exercise detection: provides landmarks (evidence: `README.md`)
- Exercise detection → Session manager: identifies exercise (evidence: `README.md`)
- Form analysis → Session manager: provides analysis (evidence: `README.md`)
- Rep counting → Session manager: tracks repetitions (evidence: `README.md`)
- Session manager → AI feedback: requests coaching (evidence: `README.md`)
- AI feedback → Gemini AI: requests feedback (evidence: `README.md`)
- AI feedback → Translation: prepares speech text (evidence: `README.md`)
- Translation → Speech generation: passes translated text (evidence: `README.md`)
- Speech generation → Murf TTS: requests speech (evidence: `README.md`)
- Speech generation → Audio playback: provides audio (evidence: `README.md`)
- Audio playback → Audio output: plays speech (evidence: `README.md`)
- Session manager → Workout database: saves workouts (evidence: `README.md`)
- Workout database → Progress analytics: supplies workout data (evidence: `README.md`)
- Workout database → Achievements: tracks milestones (evidence: `README.md`)
- Workout database → Global challenges: records contributions (evidence: `README.md`)
- Workout database → Social features: supports community features (evidence: `README.md`)
- Session manager → Workout database: gets or creates user (evidence: `voicegym.py`)
- Session manager → Achievements: announces unlocks (evidence: `voicegym.py`)
