Metadata-Version: 2.4
Name: speech-denoise
Version: 1.2.0
Summary: Remove mains hum, fan noise and hiss from speech recordings. Free for personal use. Measured on real speech: hum band drops 23.6 dB, speech band moves only 0.6 dB, overall SNR 5.0 to 14.7 dB. Tells you when it did not work.
Author: gem3match-dev
License: MIT
Project-URL: Homepage, https://github.com/gem3match-dev/speech-denoise
Project-URL: Source, https://github.com/gem3match-dev/speech-denoise
Project-URL: Issues, https://github.com/gem3match-dev/speech-denoise/issues
Project-URL: Product page, https://gem3match-dev.github.io/speech-denoise/
Project-URL: Changelog, https://github.com/gem3match-dev/speech-denoise/releases
Keywords: denoise,noise reduction,speech enhancement,audio cleanup,hum removal,mains hum,hiss removal,podcast,interview audio,field recording,voice,wav,batch processing,spectral subtraction,wiener filter,audio restoration,ffmpeg
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: License :: Free for non-commercial use
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
Classifier: Topic :: Multimedia :: Sound/Audio :: Conversion
Classifier: Topic :: Multimedia :: Sound/Audio :: Editors
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21
Requires-Dist: scipy>=1.9
Requires-Dist: librosa>=0.10
Requires-Dist: soundfile>=0.12
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: matplotlib>=3.7; extra == "dev"
Dynamic: license-file

# speech-denoise

Remove mains hum, fan noise and hiss from speech recordings. One command, no server, nothing uploaded — the audio never leaves your machine.

```bash
pip install speech-denoise
speech-denoise recording.wav
```

Video input works too — drop in an `.mp4` and the audio track is extracted automatically (needs `ffmpeg` on PATH).

---

## Free for personal use. Pay once if it earns you money.

The code is the same either way. There is no crippled version, no file limit, no watermark, no account.

| | |
|---|---|
| **Personal use** | Free. Your own recordings, study, teaching, hobby projects with no revenue. |
| **Commercial use** | $19 once. Client work, paid podcasts and channels, audio for a product you sell, anything done as part of a job. |

[Commercial licence — $19](https://longjiao5.gumroad.com/l/hyotu) · 30-day refund · no subscription, no expiry

Students, teachers and non-profits: write to longjiao1986@vip.qq.com and a free commercial licence is normally granted.

Full terms: [LICENSE](https://github.com/gem3match-dev/speech-denoise/blob/main/LICENSE)

---

## Measured, not claimed

Real speech at 5 dB SNR, band by band:

| Band | Change |
|---|---|
| Mains hum 0–150 Hz | **−23.6 dB** |
| Low 150–300 Hz | −4.5 dB |
| Speech 300–3400 Hz | **−0.6 dB** |
| High 3.4–6 kHz | −7.5 dB |
| Hiss 6–8 kHz | −6.9 dB |

Overall SNR **5.0 → 14.7 dB**. The speech band moves by 0.6 dB. Nothing in 300–3400 Hz is synthesised or regenerated — it is filtered.

Across 24 combinations (4 voices × 6 noise conditions): average gain **+7.10 dB**, worst case **−2.44 dB**, **21 of 24 improved**.

---

## It tells you when it did not work

Every run ends with a verdict, computed from the noise-floor drop versus how far the speech band moved:

| Verdict | Meaning |
|---|---|
| `ALREADY_CLEAN` | Noise floor already 35+ dB below the speech band. Nothing to remove. |
| `GOOD` | Noise floor dropped ≥3 dB, speech band moved <1.5 dB. |
| `MILD` | Noise floor dropped 1–3 dB. Listen first. |
| `CAUTION` | The speech band itself moved down >1.5 dB. Heavy reverb or overlapping speakers — listen before using. |
| `LITTLE` | Almost nothing changed. Probably a noise type it does not handle. |

Regression-tested over 24 combinations: **23 of 24 verdicts matched the measured outcome.**

---

## Usage

```bash
# process one file
speech-denoise recording.wav

# write to a specific output
speech-denoise recording.wav cleaned.wav

# report only, no output file
speech-denoise --report recording.wav

# video input
speech-denoise interview.mp4
```

Or as a module:

```bash
python -m speech_denoise recording.wav
```

---

## Where it does not work

Read this before installing.

- **Heavy reverb.** 2 of 4 test cases got *worse* (worst −2.44 dB). Reflections are not noise; removing them damages the speech.
- **Two people talking at once.** 1 of 4 cases got worse. It cannot separate speakers and will sometimes suppress one.
- **Badly clipped recordings.** What's gone cannot come back.
- **Very low bitrate codec artefacts.** Only partly reduced.

If your recording has heavy reverb or overlapping speakers, this is the wrong tool — and it will say so with a `CAUTION` verdict rather than silently degrading your audio.

---

## How the adaptive mode works

The tool estimates the noise level before processing, then picks a strategy:

| Estimated SNR | Strategy |
|---|---|
| < 8 dB | strong — spectral subtraction |
| 8–18 dB | medium — Wiener-style gain |
| > 18 dB | light — minimal touch, preserve fidelity |

A fixed preset cannot handle a folder where some files are clean and some are noisy. This can.

---

## Output

16-bit PCM WAV at the original sample rate, loudness-matched to the input, peak-limited to avoid clipping.

## Requirements

Python 3.9+, `numpy`, `scipy`, `librosa`, `soundfile`. `ffmpeg` optional for video input.

Everything runs locally. No account, no API key, no upload.

## Licence

MIT. Use it on any number of your own or client projects.
