Skip to main content

ClipDetect

Build Status PyPI package license standard-readme compliant

Detect clipping in your wav files

Table of Contents

Background

This library is for detecting clipping in audio even if the audio has been normalized (ie does not actually produce the maximum possible value given the bit depth). I implemented this library from the pseudocode in this paper - please cite them if you use this.

Install

To use this package just run pip install clipdetect or uv add clipdetect if you use uv.

Usage

To detect a single file:

clipdetect path/to/file.wav

To detect all wav files in a folder:

clipdetect path/to/folder

Results for a folder will be written to csv format.

Export to TextGrid

The following will export a Praat TextGrid of the clipping sections

clipdetect path/to/file.wav --textgrid

You can also do it for a whole folder:

clipdetect path/to/folder --textgrid

Maintainers

@roedoejet.

Contributing

Feel free to dive in! Open an issue or submit PRs.

This repo follows the Contributor Covenant Code of Conduct.

Have a look at Contributing.md for help using our standardized formatting conventions and pre-commit hooks.

Citation

If you use this work in a project of yours and write about it, please feel free to link to this repo but also cite the authors of the algorithm using the following:

Hansen, John H. L., Allen Stauffer, and Wei Xia. “Nonlinear Waveform Distortion: Assessment and Detection of Clipping on Speech Data and Systems.” Speech Communication 134 (2021): 20–31. https://doi.org/10.1016/j.specom.2021.07.007.

Or in BibTeX:

@article{HANSEN202120,
title = {Nonlinear waveform distortion: Assessment and detection of clipping on speech data and systems},
journal = {Speech Communication},
volume = {134},
pages = {20-31},
year = {2021},
issn = {0167-6393},
doi = {https://doi.org/10.1016/j.specom.2021.07.007},
url = {https://www.sciencedirect.com/science/article/pii/S0167639321000832},
author = {John H.L. Hansen and Allen Stauffer and Wei Xia},
keywords = {Audio clipping, Speech quality assessment, Non-linear distortion, Speaker recognition},
abstract = {Speech, speaker, and language systems have traditionally relied on carefully collected speech material for training acoustic models. There is an enormous amount of freely accessible audio content. A major challenge, however, is that such data is not professionally recorded, and therefore may contain a wide diversity of background noise, nonlinear distortions, or other unknown environmental or technology-based contamination or mismatch. There is a crucial need for automatic analysis to screen such unknown datasets before acoustic model development training, or to perform input audio purity screening prior to classification. In this study, we propose a waveform based clipping detection algorithm for naturalistic audio streams and examine the impact of clipping at different severities on speech quality measurements and automatic speaker recognition systems. We use the TIMIT and NIST SRE08 corpora as case studies. The results show, as expected, that clipping introduces a nonlinear distortion into clean speech data, which reduces speech quality and performance for speaker recognition. We also investigate what degree of clipping can be present to sustain effective speech system performance. The proposed detection system, which will be released, could contribute to massive new audio collections for speech and language technology development (e.g. Google Audioset (Gemmeke et al., 2017), CRSS-UTDallas Apollo Fearless-Steps (Yu et al., 2014) (19,000 h naturalistic audio from NASA Apollo missions)).}
}

License

MIT. See LICENSE for the Copyright and license statements.

Metadata

Release files for clipdetect 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clipdetect 0.2.0
File Size Uploaded
clipdetect-0.2.0.tar.gz 756.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clipdetect 0.2.0
File Interpreter ABI Platform
clipdetect-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 767.4 kB

Release files / clipdetect-0.2.0.tar.gz

Download URL clipdetect-0.2.0.tar.gz
Size 756.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4b3d4ae37eec413dd742ef58265a91f50004cf3901bd3809a450419190c9b83b
BLAKE2b-256 checksum
How to use checksums
7c7683fe34c64659957cad4fb02af667899581df388f019a84a8c4505524df62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / clipdetect-0.2.0-py3-none-any.whl

Download URL clipdetect-0.2.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
487b7c784ee6fe93928ba9e6fe233ea2172184fb91d9525b8cb3234741833b96
BLAKE2b-256 checksum
How to use checksums
0add38a7def21d7ff17faea33e0be2361ccf390cd3a99da3984815a1d1633ad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page