Skip to main content

Apply audio effects such as reverb and EQ directly to audio files or NumPy ndarrays.

Project description

Apply audio effects such as reverb and EQ directly to audio files or NumPy ndarrays.

This is a lightweight Python wrapper for SoX, the Swiss Army knife of sound processing programs. Supported effects range from EQ, compression and noise reduction to phasers, reverbs and pitch shifters.

Install

Install with pip as:

pip install pysndfx

The system must also have SoX installed (for Debian-based operating systems: apt install sox, or with Anaconda as conda install -c conda-forge sox)

Usage

First create an audio effects chain.

# Import the package and create an audio effects chain.
from pysndfx import AudioEffectsChain
apply_audio_fx = (AudioEffectsChain()
                     .phaser()
                     .reverb())

Then we can call the effects chain object with paths to audio files, or directly with NumPy ndarrays.

infile = 'my_audio_file.wav'
outfile = 'my_processed_audio_file.ogg'

# Apply phaser and reverb directly to an audio file.
apply_audio_fx(infile, outfile)

# Or, apply the effects directly to a NumPy ndarray.
from librosa import load
x, sr = load(infile, sr=None)
y = apply_audio_fx(x)

# Apply the effects and return the results as a NumPy ndarray.
y = apply_audio_fx(infile)

# Apply the effects to a NumPy ndarray but store the resulting audio to disk.
apply_audio_fx(x, outfile)

There’s also experimental streaming support. Try applying reverb to a microphone input and listening to the results live like this:

python -c "from pysndfx import AudioEffectsChain; AudioEffectsChain().reverb()(None, None)"

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

pysndfx-0.0.6.tar.gz (4.5 kB view details)

Uploaded Source

Built Distributions

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

pysndfx-0.0.6-py3.5.egg (8.0 kB view details)

Uploaded Egg

pysndfx-0.0.6-py2.7.egg (7.7 kB view details)

Uploaded Egg

File details

Details for the file pysndfx-0.0.6.tar.gz.

File metadata

  • Download URL: pysndfx-0.0.6.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysndfx-0.0.6.tar.gz
Algorithm Hash digest
SHA256 de95199d06e310cbc58049b266235afbae0e91484efcf8ef2ab18590d8204d4b
MD5 9ca39877565dcfa370c2c46b417864f6
BLAKE2b-256 81a44b81389c1b6716598ff7aa692b21fd615c5f85fa9fe9fcbb13dede0cce2e

See more details on using hashes here.

File details

Details for the file pysndfx-0.0.6-py3.5.egg.

File metadata

  • Download URL: pysndfx-0.0.6-py3.5.egg
  • Upload date:
  • Size: 8.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysndfx-0.0.6-py3.5.egg
Algorithm Hash digest
SHA256 c1c493383241bf24d19f4cc66c3a20db0618a924338f74080d80c146a45bebcf
MD5 89a2b29ee53b339f0521f5f3658f550e
BLAKE2b-256 654dcfecdd9bb56714aa08f226805992a471bff84770872e5c8a59014062fa85

See more details on using hashes here.

File details

Details for the file pysndfx-0.0.6-py2.7.egg.

File metadata

  • Download URL: pysndfx-0.0.6-py2.7.egg
  • Upload date:
  • Size: 7.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysndfx-0.0.6-py2.7.egg
Algorithm Hash digest
SHA256 04afddaa6e13111f029b5a2b1d166e8aca2a0da01d429b53dc588fb5b7fd756c
MD5 af92bf935246e32e527d4cd4cb448c14
BLAKE2b-256 bac915b2de5d38be1ad82240abf94d4566bc4e2bad5a92d39f9951f6e817a80c

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