Socket
Book a DemoInstallSign in
Socket

audio-glitch-detector

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-glitch-detector

Detect audio glitches and discontinuities in sinusoidal audio signals

pipPyPI
Version
0.2.1
Maintainers
1

Audio Glitch Detector

PyPI version Python 3.12+ License: MIT

Detect audio glitches and discontinuities in sinusoidal audio signals by analyzing the signal derivative.

Important: This tool is will only work with sinusoidal audio signals.

Limitations

The algorithm detects discontinuities, so glitches that does not directly produce discontinuities might not be picked up. It can detect single sample errors in a sine wave. The test files in test_files/ show cases where the algorithm works well.

Installation

From PyPI

pip install audio-glitch-detector

From source with uv (development)

git clone https://github.com/kaspernyhus/audio-glitch-detector
cd audio-glitch-detector
uv sync --dev

Quick Start

Command Line Usage

Analyze a WAV file with automatic threshold:

audio-glitch-detector -f path/to/audio.wav

Monitor live audio stream:

audio-glitch-detector

Save glitch blocks for analysis:

audio-glitch-detector -f audio.wav --save-blocks

Library Usage

see examples/ for usage examples.

Visual Analysis

When using --save-blocks, glitch blocks (max 50) are saved as .wav files and with waveform visualizations showing the derivative analysis:

Glitch Block Visualization

Test Files

Validate the detector with test files with a known number of discontinuities:

audio-glitch-detector -f test_files/sine_discont_2_mono.wav

Expected output:

Number of discontinuities detected: 2
0:00:01.892857
0:00:03.288367

How It Works

  • Derivative Analysis: Calculates the first derivative of audio samples
  • Threshold Detection: Uses 99.5th percentile of derivative distribution
  • Peak Identification: Finds samples exceeding the threshold

Development

Setup

uv sync --dev

Run the application

uv run audio-glitch-detector --help

Run tests

uv run pytest

Keywords

audio

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.