Sonic Gate

Stop paying humans to listen to corrupted audio files.
Fix them automatically.

PyPI v0.1.1 Python 3.9+ MIT License FFmpeg

What is it?

Sonic Gate is a CLI-first audio/video quality gate that uses deterministic audio analysis to catch corrupted, invalid, or low-quality media files before they reach human reviewers or downstream pipelines.

Unlike tools that rely on slow, unreliable AI for everything, Sonic Gate uses fast, accurate signal processing (LUFS, silence detection, format validation) and only optionally adds AI probing when you explicitly want it.

Features

LUFS Analysis

Measure integrated loudness using FFmpeg ebur128. Ensure your audio meets broadcast standards.

Silence Detection

Find dead air, trailing silence, and gaps using pydub. Configurable thresholds.

Format Validation

Detect corrupted files, wrong codecs, and unsupported formats before they crash your pipeline.

Video Support

Auto-extract audio from MP4, MOV, AVI, MKV, WebM for analysis without manual conversion.

Fix Mode

Auto-trim silence, normalize LUFS, remove DC offset. Non-destructive output to ./fixed.

Optional AI Probe

Whisper-based speech detection and language validation. Off by default. Install with pip install "sonic-gate[ai]".

Quick Start

# Install
pip install sonic-gate

# Analyze a file
sonic-gate interview.wav

# Analyze a directory
sonic-gate ./recordings/

# JSON output for CI
sonic-gate --format json ./files/ > report.json

# Fix failed files
sonic-gate --fix ./recordings/

Why Sonic Gate?

Fast: ~4ms per file for traditional analysis. No GPU needed.

Deterministic: Same input, same output. No random AI hallucinations.

Language-agnostic: Works with any audio — English, Kinyarwanda, Tibetan, silence, music. No training data bias.

CI-friendly: Exit code 1 on failure. JSON output. Configurable rules.