Skip to main content

A production-grade Python audio enhancement toolkit

Project description

AudioEnhancer

A production-grade Python audio enhancement toolkit.

PyPI version Python versions License: MIT CI Status

Why AudioEnhancer?

AudioEnhancer is designed for developers who need robust, high-quality audio post-processing without complex configurations. By decoupling algorithms into standardized strategies, it offers a clean, extensible, and pattern-driven API for noise removal, level normalization, and seamless format conversions.

Features

  • 🤫 Noise Removal: Spectral gating for stationary noise and median filtering for impulse clicks/pops.
  • 🎚️ Loudness Normalization: Support for Peak, RMS, and broadcast-standard LUFS (ITU-R BS.1770) normalization.
  • 🔁 Format Conversion: Convert easily between standard formats like WAV, MP3, FLAC, and more.
  • 🛠️ Fluent Pipeline Builder: Build and execute custom chains using a modern builder API.
  • 🖥️ Command-Line Interface (CLI): Powerful, Click-powered command-line interface for quick batch or single file processing.

Prerequisites

This project requires FFmpeg to be installed and available in your system's PATH.

  • macOS: brew install ffmpeg
  • Ubuntu/Debian: sudo apt-get update && sudo apt-get install -y ffmpeg
  • Windows: Install via Chocolatey choco install ffmpeg or download binaries directly.

Installation

Standard Installation (from PyPI)

pip install audioenhancer

Installation from Source

  1. Clone the repository:
    git clone https://github.com/CodeWithBotinaOficial/audio_enhancer.git
    cd audio_enhancer
    
  2. Create a virtual environment and install dependencies:
    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    pip install -r requirements.txt
    

Usage

Command-Line Interface (CLI)

The CLI provides a quick way to process audio files. You can run it as a module or after installing the package:

python -m audio_enhancer process-file examples/sample_audio/input.wav examples/output/output.mp3 --noise-profile spectral_gate --normalize lufs --lufs -16.0

Library Usage

The project can be used as a Python library by importing the AudioEnhancer facade:

from audio_enhancer import AudioEnhancer
from audio_enhancer.normalization.lufs import LufsNormalizer
from audio_enhancer.noise_reduction.spectral_gating import SpectralGatingNoiseReducer

def main():
    # Create an enhancer instance
    enhancer = AudioEnhancer.get_instance()

    # Load an audio file
    audio = enhancer.load_audio("examples/sample_audio/input.wav")

    # Create a processing pipeline
    pipeline = (
        enhancer.get_builder()
        .add_step(SpectralGatingNoiseReducer())
        .add_step(LufsNormalizer(-16.0))
        .build()
    )

    # Apply the pipeline
    enhanced_audio = pipeline.process(audio)

    # Export the result
    enhancer.export_audio(enhanced_audio, "examples/output/enhanced_audio.flac", "flac")
    print("Audio enhancement complete.")

if __name__ == "__main__":
    main()

Design Patterns

This project serves as a practical example of various software design patterns:

  • Facade: AudioEnhancer class provides a simple, high-level interface.
  • Strategy: Different normalization and noise reduction algorithms are implemented as strategies.
  • Builder: PipelineBuilder constructs complex processing pipelines step-by-step.
  • Singleton: The Logger and AudioEnhancer use the Singleton pattern.
  • Factory Method: Used to create different audio processors.

Documentation

Full documentation, including tutorials, guide, and API reference, is available at https://codewithbotinaoficial.github.io/audio_enhancer/.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2026 Diego Alejandro Botina (CodeWithBotina).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audioenhancer-0.0.2.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audioenhancer-0.0.2-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file audioenhancer-0.0.2.tar.gz.

File metadata

  • Download URL: audioenhancer-0.0.2.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for audioenhancer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 46700d8e726615d2c67b6fc9271c4b9955b578ef85c42a3f1def82063d6a5dae
MD5 9e24172e4b3447e8898c7d8ff30062c2
BLAKE2b-256 5a48420c2f060b9b354d515fef237fad11ce1945b498f740172b5df48b9b8588

See more details on using hashes here.

File details

Details for the file audioenhancer-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: audioenhancer-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for audioenhancer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2421ffe6ae851b46c60f3e6749581d019caef7a3dc21e704f6ae3051f66573a5
MD5 cfd749dc8e2995803bc33bf455a458d2
BLAKE2b-256 bc868a4ec57be5bfb2d4ffae996162b3a03a910c3f6d5c700585bba0cabeb3ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page