# biglinux/speech-enhancement-native architecture

> Architecture diagram of the GitHub repository biglinux/speech-enhancement-native, 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/biglinux/speech-enhancement-native
- Repository: https://github.com/biglinux/speech-enhancement-native

## Overview

This repository provides native Rust inference engines for speech enhancement, voice activity detection and echo cancellation, exposed through audio-host plugins and a DPDFNet whole-file CLI. The principal workflow is audio input through a host-facing adapter into model inference and enhanced audio output; GTCRN-AEC separately processes microphone and far-end reference audio. README statements establish the product capabilities and some plugin integrations; source-index references support internal module relationships. Several unsampled implementation details are omitted rather than inferred.

Main entry points: [`deepfilternet3/dfn3-plugin/src/lib.rs`](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-plugin/src/lib.rs) (Streaming denoiser), [`deepfilternet3/dfn3-ladspa/src/lib.rs`](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-ladspa/src/lib.rs) (DFN3 LADSPA), [`dpdfnet/src/ladspa.rs`](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/ladspa.rs) (DPDFNet LADSPA), [`dpdfnet/src/model.rs`](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/model.rs) (DPDFNet model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dfn["DeepFilterNet3"]
  node_dfn_ladspa["DFN3 LADSPA<br/>[lib.rs]"]
  node_dfnll_ladspa["DFN3-LL LADSPA<br/>[lib.rs]"]
  node_dfn_pipeline["Streaming denoiser<br/>[lib.rs]"]
  node_dfn_network["DFN3 network<br/>[lib.rs]"]
  node_dfnll_network["DFN3-LL network<br/>[lib.rs]"]
  node_dfn_expander["Expander<br/>[expander.rs]"]
end

subgraph group_dpdf["DPDFNet"]
  node_dpdf_ladspa["DPDFNet LADSPA<br/>[ladspa.rs]"]
  node_dpdf_audio["Audio processor<br/>[audio.rs]"]
  node_dpdf_model["DPDFNet model<br/>[model.rs]"]
  node_dpdf_layers["Model layers<br/>[mod.rs]"]
  node_dpdf_offline["Whole-file processing<br/>[offline.rs]"]
  node_dpdf_cli["Enhancement CLI<br/>[dpdfnet-enhance.rs]"]
  node_dpdf_c_api["C API<br/>[ffi.rs]"]
end

subgraph group_gtcrn["GTCRN echo cancellation"]
  node_gtcrn_spa["PipeWire SPA plugin<br/>[engine.rs]"]
  node_gtcrn_stream["Streaming AEC<br/>[stream.rs]"]
  node_gtcrn_daf["DAF frontend<br/>[block.rs]"]
  node_gtcrn_model["GTCRN model<br/>[layers.rs]"]
  node_gtcrn_gguf["GGUF reader<br/>[gguf.rs]"]
end

subgraph group_vad["Voice detection"]
  node_silero["Silero VAD<br/>[lib.rs]"]
  node_firered["FireRedVAD<br/>[lib.rs]"]
end

subgraph group_shared["Shared runtime and adapters"]
  node_ops["Numeric kernels<br/>[lib.rs]"]
  node_limiter["Peak limiter<br/>[lib.rs]"]
end

node_audio_host(("Audio host"))

node_audio_host -->|"supplies audio"| node_dfn_ladspa
node_audio_host -->|"supplies audio"| node_dfnll_ladspa
node_audio_host -->|"supplies audio"| node_dpdf_ladspa
node_audio_host -->|"supplies audio"| node_gtcrn_spa
node_dfn_ladspa -->|"uses pipeline"| node_dfn_pipeline
node_dfnll_ladspa -->|"uses pipeline"| node_dfn_pipeline
node_dfn_pipeline -->|"runs network"| node_dfn_network
node_dfn_pipeline -->|"runs network"| node_dfnll_network
node_dfn_pipeline -->|"uses expander"| node_dfn_expander
node_dfn_ladspa -.->|"can gate with"| node_silero
node_dfn_ladspa -.->|"can gate with"| node_firered
node_dpdf_ladspa -.->|"processes audio"| node_dpdf_audio
node_dpdf_audio -.->|"runs inference"| node_dpdf_model
node_dpdf_model -->|"uses layers"| node_dpdf_layers
node_dpdf_cli -.->|"runs offline"| node_dpdf_offline
node_dpdf_offline -.->|"speech-only detection"| node_firered
node_dpdf_ladspa -.->|"optional voice gate"| node_silero
node_dpdf_ladspa -.->|"optional voice gate"| node_firered
node_gtcrn_spa -.->|"drives stream"| node_gtcrn_stream
node_gtcrn_stream -->|"uses frontend"| node_gtcrn_daf
node_gtcrn_stream -.->|"runs core"| node_gtcrn_model
node_gtcrn_daf -->|"loads tensors"| node_gtcrn_gguf
node_gtcrn_model -->|"reads weights"| node_gtcrn_gguf
node_dfn_pipeline -.->|"uses kernels"| node_ops
node_dpdf_model -.->|"uses kernels"| node_ops
node_gtcrn_model -.->|"uses kernels"| node_ops
node_silero -.->|"uses kernels"| node_ops
node_audio_host -->|"supplies audio"| node_limiter
node_dpdf_c_api -->|"exposes engine"| node_dpdf_model

click node_dfn_ladspa "https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-ladspa/src/lib.rs"
click node_dfnll_ladspa "https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3ll-ladspa/src/lib.rs"
click node_dfn_pipeline "https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-plugin/src/lib.rs"
click node_dfn_network "https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-ladspa/src/lib.rs"
click node_dfnll_network "https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3ll-ladspa/src/lib.rs"
click node_dfn_expander "https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-plugin/src/expander.rs"
click node_dpdf_ladspa "https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/ladspa.rs"
click node_dpdf_audio "https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/audio.rs"
click node_dpdf_model "https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/model.rs"
click node_dpdf_layers "https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/layers/mod.rs"
click node_dpdf_offline "https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/offline.rs"
click node_dpdf_cli "https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/bin/dpdfnet-enhance.rs"
click node_gtcrn_spa "https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/spa-aec-gtcrn/src/engine.rs"
click node_gtcrn_stream "https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/model/stream.rs"
click node_gtcrn_daf "https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/daf/block.rs"
click node_gtcrn_model "https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/model/layers.rs"
click node_gtcrn_gguf "https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/gguf.rs"
click node_silero "https://github.com/biglinux/speech-enhancement-native/blob/main/silero-vad/src/lib.rs"
click node_firered "https://github.com/biglinux/speech-enhancement-native/blob/main/firered-vad/src/lib.rs"
click node_ops "https://github.com/biglinux/speech-enhancement-native/blob/main/ops/src/lib.rs"
click node_limiter "https://github.com/biglinux/speech-enhancement-native/blob/main/limiter-ladspa/src/lib.rs"
click node_dpdf_c_api "https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/ffi.rs"

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_dfn_ladspa,node_dfnll_ladspa,node_dfn_pipeline,node_dfn_network,node_dfnll_network,node_dfn_expander toneBlue
class node_dpdf_ladspa,node_dpdf_audio,node_dpdf_model,node_dpdf_layers,node_dpdf_offline,node_dpdf_cli,node_dpdf_c_api toneAmber
class node_gtcrn_spa,node_gtcrn_stream,node_gtcrn_daf,node_gtcrn_model,node_gtcrn_gguf toneMint
class node_silero,node_firered toneRose
class node_ops,node_limiter,node_audio_host toneIndigo
```

## Components

### DeepFilterNet3

- [DFN3 LADSPA](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-ladspa/src/lib.rs): `deepfilternet3/dfn3-ladspa/src/lib.rs`
- [DFN3-LL LADSPA](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3ll-ladspa/src/lib.rs): `deepfilternet3/dfn3ll-ladspa/src/lib.rs`
- [Streaming denoiser](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-plugin/src/lib.rs): `deepfilternet3/dfn3-plugin/src/lib.rs`
- [DFN3 network](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-ladspa/src/lib.rs): `deepfilternet3/dfn3-ladspa/src/lib.rs`
- [DFN3-LL network](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3ll-ladspa/src/lib.rs): `deepfilternet3/dfn3ll-ladspa/src/lib.rs`
- [Expander](https://github.com/biglinux/speech-enhancement-native/blob/main/deepfilternet3/dfn3-plugin/src/expander.rs): `deepfilternet3/dfn3-plugin/src/expander.rs`

### DPDFNet

- [DPDFNet LADSPA](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/ladspa.rs): `dpdfnet/src/ladspa.rs`
- [Audio processor](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/audio.rs): `dpdfnet/src/audio.rs`
- [DPDFNet model](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/model.rs): `dpdfnet/src/model.rs`
- [Model layers](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/layers/mod.rs): `dpdfnet/src/layers/mod.rs`
- [Whole-file processing](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/offline.rs): `dpdfnet/src/offline.rs`
- [Enhancement CLI](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/bin/dpdfnet-enhance.rs): `dpdfnet/src/bin/dpdfnet-enhance.rs`
- [C API](https://github.com/biglinux/speech-enhancement-native/blob/main/dpdfnet/src/ffi.rs): `dpdfnet/src/ffi.rs`

### GTCRN echo cancellation

- [PipeWire SPA plugin](https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/spa-aec-gtcrn/src/engine.rs): `gtcrn-aec/spa-aec-gtcrn/src/engine.rs`
- [Streaming AEC](https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/model/stream.rs): `gtcrn-aec/gtcrn-aec/src/model/stream.rs`
- [DAF frontend](https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/daf/block.rs): `gtcrn-aec/gtcrn-aec/src/daf/block.rs`
- [GTCRN model](https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/model/layers.rs): `gtcrn-aec/gtcrn-aec/src/model/layers.rs`
- [GGUF reader](https://github.com/biglinux/speech-enhancement-native/blob/main/gtcrn-aec/gtcrn-aec/src/gguf.rs): `gtcrn-aec/gtcrn-aec/src/gguf.rs`

### Voice detection

- [Silero VAD](https://github.com/biglinux/speech-enhancement-native/blob/main/silero-vad/src/lib.rs): `silero-vad/src/lib.rs`
- [FireRedVAD](https://github.com/biglinux/speech-enhancement-native/blob/main/firered-vad/src/lib.rs): `firered-vad/src/lib.rs`

### Shared runtime and adapters

- [Numeric kernels](https://github.com/biglinux/speech-enhancement-native/blob/main/ops/src/lib.rs): `ops/src/lib.rs`
- [Peak limiter](https://github.com/biglinux/speech-enhancement-native/blob/main/limiter-ladspa/src/lib.rs): `limiter-ladspa/src/lib.rs`

### Other components

- **Audio host**

## Connections

- Audio host → DFN3 LADSPA: supplies audio
- Audio host → DFN3-LL LADSPA: supplies audio
- Audio host → DPDFNet LADSPA: supplies audio
- Audio host → PipeWire SPA plugin: supplies audio
- DFN3 LADSPA → Streaming denoiser: uses pipeline (evidence: `deepfilternet3/dfn3-ladspa/src/lib.rs`)
- DFN3-LL LADSPA → Streaming denoiser: uses pipeline (evidence: `deepfilternet3/dfn3ll-ladspa/src/lib.rs`)
- Streaming denoiser → DFN3 network: runs network
- Streaming denoiser → DFN3-LL network: runs network
- Streaming denoiser → Expander: uses expander (evidence: `deepfilternet3/dfn3-plugin/src/lib.rs`)
- DFN3 LADSPA → Silero VAD: can gate with
- DFN3 LADSPA → FireRedVAD: can gate with
- DPDFNet LADSPA → Audio processor: processes audio
- Audio processor → DPDFNet model: runs inference
- DPDFNet model → Model layers: uses layers (evidence: `dpdfnet/src/model.rs`)
- Enhancement CLI → Whole-file processing: runs offline
- Whole-file processing → FireRedVAD: speech-only detection
- DPDFNet LADSPA → Silero VAD: optional voice gate
- DPDFNet LADSPA → FireRedVAD: optional voice gate
- PipeWire SPA plugin → Streaming AEC: drives stream
- Streaming AEC → DAF frontend: uses frontend
- Streaming AEC → GTCRN model: runs core
- DAF frontend → GGUF reader: loads tensors (evidence: `gtcrn-aec/gtcrn-aec/src/daf/mod.rs`)
- GTCRN model → GGUF reader: reads weights (evidence: `gtcrn-aec/gtcrn-aec/src/model.rs`)
- Streaming denoiser → Numeric kernels: uses kernels
- DPDFNet model → Numeric kernels: uses kernels
- GTCRN model → Numeric kernels: uses kernels
- Silero VAD → Numeric kernels: uses kernels
- Audio host → Peak limiter: supplies audio
- C API → DPDFNet model: exposes engine (evidence: `dpdfnet/src/ffi.rs`)
