Audio limiter in Cython.
Project description
cylimiter
A small package with stateful audio limiter implementation in Cython. Since the limiter is stateful it is suitable for streaming audio processing.
Examples
import numpy as np
from cylimiter import Limiter
limiter = Limiter(attack=0.5, release=0.9, delay=100, threshold=0.9)
chunk_size = 1200 # for streaming processing
# Example of applying limiter in-place (more efficient)
audio = np.random.randn(44100) * 10
for i in range(0, 44100, chunk_size):
chunk = audio[i * chunk_size: (i + 1) * chunk_size]
limiter.limit_inplace(chunk)
# ... do sth with chunk
# Example of applying limiter that copies the signal
audio = np.random.randn(1, 44100) * 10
audio_lim = limiter.limit(audio)
# Reset the limiter to re-use it on other signals
limiter.reset()
Motivation
I couldn't easily find a package that implements audio limiter in Python in a suitable way for streaming audio. The closest (and the main inspiration) is this gist by @bastibe. Since the algorithm is auto-regressive, I figured C++ will be much more efficient than Python.
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
cylimiter-0.1.tar.gz
(41.7 kB
view details)
Built Distribution
File details
Details for the file cylimiter-0.1.tar.gz
.
File metadata
- Download URL: cylimiter-0.1.tar.gz
- Upload date:
- Size: 41.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44884021ee4c7468d027f6138866b051f72858f6217313c349ffc2a40310e0dd |
|
MD5 | 7770de19efcb8cb2eeb510513738116d |
|
BLAKE2b-256 | c74d678ff9cd1213cf70f3db381afc9940fdd3a187bf50102fe1fe8f41b059d8 |
File details
Details for the file cylimiter-0.1-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: cylimiter-0.1-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 24.8 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0cf2c90959d2a37118103a7ecbd69ac85ca6312ca1ca1d999f50522fa88942b |
|
MD5 | 863626ec1978f65d57fad88fca8c09c1 |
|
BLAKE2b-256 | 14c09bc6831d8c85eb9034348f8780f0d75605734480dd61ed34c6bd6d6c2b74 |