Skip to main content

Tools for processing audio signals

Project description

Audio Toolset

CI Workflow status CD Workflow status GitHub Release PyPI - Version Python Version from PEP 621 TOML

A Python library for processing audio signals.

audio_toolset provides an intuitive and flexible way to process audio files in Python. Each Channel object handles a single mono audio file, allowing you to apply filters, EQ, dynamic processing, gain adjustments, noise reduction, and more.

[!TIP] Stereo files can be handled by first splitting them into mono channels using split_to_mono and then recombining them with join_to_stereo. see example

Installation

pip install audio-toolset

Examples

Quickstart

from audio_toolset.channel import Channel

track = Channel("my_audio.wav")

track.lowpass(cutoff_frequency=12000)  # Remove harsh high frequencies
track.highpass(cutoff_frequency=80)  # Remove low-end rumble
track.normalize(target_db=-1)  # Normalize

track.write("my_audio_processed.wav")

Process multiple files

This is very handy when you need to apply the same processing to multiple files, for example a directory with sound effects.

import pathlib
from audio_toolset.channel import Channel

input_dir = pathlib.Path("input_audio")
output_dir = pathlib.Path("cleaned_audio")
output_dir.mkdir(exist_ok=True)

for wav_file in input_dir.glob("*.wav"):
    track = Channel(wav_file)

    track.fade(fade_duration_ms=10)  # Remove start/end pops if present
    track.lowpass(cutoff_frequency=12000)  # Remove harsh high frequencies
    track.highpass(cutoff_frequency=80)  # Remove low-end rumble
    track.normalize(target_db=-1)  # Normalize

    track.write(output_dir / wav_file.name)

Working with stereo files

from audio_toolset.audio_data import AudioData, join_to_stereo
from audio_toolset.channel import Channel

# Load stereo audio file
stereo_data = AudioData.read_from_file("my_audio.wav")

# Split stereo into left and right channels
left_data, right_data = stereo_data.split_to_mono()
left_channel = Channel(left_data)
right_channel = Channel(right_data)

# Process each channel
for track in [left_channel, right_channel]:
    track.lowpass(cutoff_frequency=12000)  # Remove harsh highs
    track.highpass(cutoff_frequency=80)  # Remove low-end rumble
    track.normalize(target_db=-1)  # Normalize

# Combine channels back to stereo and save
join_to_stereo(left_channel.audio_data, right_channel.audio_data).write_to_file(
    "my_audio_processed.wav"
)

Features

  • High level Channel object for simple user interface
  • Load audio from a file or AudioData
  • Gain processing
    • gain, normalize, fade
  • Filters
    • lowpass, highpass, eq_band
    • noise_reduction (spectral gating)
  • Dynamics
    • compressor, limiter, soft_clipping
  • Plotting tools (see examples)
    • plot_signal - generate signal time and frequency plot
    • Dynamic plots - compressor, limiter can generate attenuation plots
    • Bode plots - lowpass, highpass, eq_band can generate filter bode plots

Plotting

audio_toolset provides multiple plotting tools to visualize signals, filters, and dynamics. All plots are generated interactively using Plotly and can be saved as images from the interactive viewer.

Signal Plots

Use plot_signal() to visualize the time-domain and frequency-domain representation of an audio channel.

signal-plot

2. Filter (Bode) Plots

Filter plots show the frequency response (Bode plot) of filters applied using eq_band(plot_filter_bode=True), highpass(plot_filter_bode=True), or lowpass(plot_filter_bode=True).

lowpass-plot parametric-eq-plot

3. Dynamics Plots

Dynamics plots visualize the response of compressors and limiters applied to a channel. Generated by compressor(plot_compressor_response=True) or limiter(plot_limiter_response=True)

compressor-plot

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

audio_toolset-0.1.1.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

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

audio_toolset-0.1.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file audio_toolset-0.1.1.tar.gz.

File metadata

  • Download URL: audio_toolset-0.1.1.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.14

File hashes

Hashes for audio_toolset-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ef99412fa4d0123c9b150619da0bcd7250839564b3ebe40a72364fe9ed8cf24f
MD5 652439386faf7048beeef5047aa558be
BLAKE2b-256 d7e377df03bfaee8b6c84240a5746b44925758adad6d953f90d4742a99068e52

See more details on using hashes here.

File details

Details for the file audio_toolset-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for audio_toolset-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9deb9544f7db163198100437c797e619c041178fb167996739dd1637ea0de4e5
MD5 5bcdfe953073293cecfcc053a20f921b
BLAKE2b-256 d23efc283d5f15b86263ac47a52be5ff81868c6ebeb681c45c26fb1c465e1e23

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