# notos15/proyecto_diarizacion architecture

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

- Interactive diagram: https://gitdiagram.com/notos15/proyecto_diarizacion
- Repository: https://github.com/notos15/proyecto_diarizacion

## Overview

This is a local audio-speaker diarization application, available through a console menu and a Flask web interface. The user selects or uploads an audio file; both entry points invoke the same analysis, which prepares audio, finds voice intervals, extracts speaker embeddings, groups them, and builds a report of attributed segments and participation times. The web client displays and can download that report. The README documents no implemented source separation, and the current analysis does not separate overlapping voices. Analysis-stage links follow the README; detailed implementation excerpts were partial.

Main entry points: [`web/static/app.js`](https://github.com/notos15/proyecto_diarizacion/blob/main/web/static/app.js) (Web client), [`src/diarizacion.py`](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py) (Audio preparation), [`src/menu.py`](https://github.com/notos15/proyecto_diarizacion/blob/main/src/menu.py) (Console menu), [`src/servidor.py`](https://github.com/notos15/proyecto_diarizacion/blob/main/src/servidor.py) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_console["Console menu<br/>[menu.py]"]
  node_webserver["HTTP server<br/>[servidor.py]"]
end

subgraph group_analysis["Diarization analysis"]
  node_audio["Audio preparation<br/>[diarizacion.py]"]
  node_vad["Voice detection<br/>[diarizacion.py]"]
  node_contexts["Voice contexts<br/>[diarizacion.py]"]
  node_embeddings["Speaker embeddings<br/>[diarizacion.py]"]
  node_clustering["Speaker grouping<br/>[diarizacion.py]"]
  node_attribution["Segment attribution<br/>[diarizacion.py]"]
  node_report["Participation report<br/>[diarizacion.py]"]
end

subgraph group_model["Voice model"]
  node_encoder["ERes2Net encoder<br/>[modelo_voz.py]"]
end

subgraph group_presentation["Results interfaces"]
  node_webclient["Web client<br/>[app.js]"]
  node_webpage["Upload page<br/>[index.html]"]
end

node_user(("User"))
node_modelhost["Model download host"]
node_browser(("Browser user"))

node_user -->|"selects audio"| node_console
node_console -->|"invokes analysis"| node_audio
node_user -->|"opens page"| node_webpage
node_webpage -->|"loads client"| node_webclient
node_browser -->|"selects audio"| node_webclient
node_webclient -->|"posts audio"| node_webserver
node_webserver -->|"invokes analysis"| node_audio
node_audio -->|"prepared waveform"| node_vad
node_vad -->|"voice intervals"| node_contexts
node_contexts -->|"voice contexts"| node_embeddings
node_embeddings -->|"requests embeddings"| node_encoder
node_encoder -.->|"downloads model"| node_modelhost
node_embeddings -->|"embedding vectors"| node_clustering
node_clustering -->|"speaker labels"| node_attribution
node_attribution -->|"builds report"| node_report
node_audio -->|"returns report"| node_report
node_webserver -->|"returns JSON"| node_webclient
node_webclient -->|"displays results"| node_browser
node_console -->|"prints results"| node_user

click node_console "https://github.com/notos15/proyecto_diarizacion/blob/main/src/menu.py"
click node_webserver "https://github.com/notos15/proyecto_diarizacion/blob/main/src/servidor.py"
click node_webclient "https://github.com/notos15/proyecto_diarizacion/blob/main/web/static/app.js"
click node_webpage "https://github.com/notos15/proyecto_diarizacion/blob/main/web/templates/index.html"
click node_audio "https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py"
click node_vad "https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py"
click node_contexts "https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py"
click node_embeddings "https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py"
click node_encoder "https://github.com/notos15/proyecto_diarizacion/blob/main/src/modelo_voz.py"
click node_clustering "https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py"
click node_attribution "https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py"
click node_report "https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.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_console,node_webserver,node_user,node_browser toneBlue
class node_audio,node_vad,node_contexts,node_embeddings,node_clustering,node_attribution,node_report toneAmber
class node_encoder toneMint
class node_webclient,node_webpage toneRose
class node_modelhost toneIndigo
```

## Components

### Entry points

- [Console menu](https://github.com/notos15/proyecto_diarizacion/blob/main/src/menu.py): `src/menu.py`
- [HTTP server](https://github.com/notos15/proyecto_diarizacion/blob/main/src/servidor.py): `src/servidor.py`

### Diarization analysis

- [Audio preparation](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py): `src/diarizacion.py`
- [Voice detection](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py): `src/diarizacion.py`
- [Voice contexts](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py): `src/diarizacion.py`
- [Speaker embeddings](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py): `src/diarizacion.py`
- [Speaker grouping](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py): `src/diarizacion.py`
- [Segment attribution](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py): `src/diarizacion.py`
- [Participation report](https://github.com/notos15/proyecto_diarizacion/blob/main/src/diarizacion.py): `src/diarizacion.py`

### Voice model

- [ERes2Net encoder](https://github.com/notos15/proyecto_diarizacion/blob/main/src/modelo_voz.py): `src/modelo_voz.py`

### Results interfaces

- [Web client](https://github.com/notos15/proyecto_diarizacion/blob/main/web/static/app.js): `web/static/app.js`
- [Upload page](https://github.com/notos15/proyecto_diarizacion/blob/main/web/templates/index.html): `web/templates/index.html`

### Other components

- **User**
- **Model download host**
- **Browser user**

## Connections

- User → Console menu: selects audio
- Console menu → Audio preparation: invokes analysis
- User → Upload page: opens page
- Upload page → Web client: loads client
- Browser user → Web client: selects audio
- Web client → HTTP server: posts audio
- HTTP server → Audio preparation: invokes analysis
- Audio preparation → Voice detection: prepared waveform
- Voice detection → Voice contexts: voice intervals
- Voice contexts → Speaker embeddings: voice contexts
- Speaker embeddings → ERes2Net encoder: requests embeddings
- ERes2Net encoder → Model download host: downloads model
- Speaker embeddings → Speaker grouping: embedding vectors
- Speaker grouping → Segment attribution: speaker labels
- Segment attribution → Participation report: builds report
- Audio preparation → Participation report: returns report
- HTTP server → Web client: returns JSON
- Web client → Browser user: displays results
- Console menu → User: prints results
