Skip to content

Instantly share code, notes, and snippets.

Avatar
Solving environment /

Scott H. Hawley drscotthawley

Solving environment /
View GitHub Profile
@drscotthawley
drscotthawley / apply_sox_effect.py
Last active Apr 29, 2018
Accessing Sox Audio Effects from Python via Pysox
View apply_sox_effect.py
import pysox
import librosa
import numpy as np
def apply_sox_effect(signal, sr, fxstr):
# This writes signal to a .wav file, processes it sox to another file, loads that and returns it.
#
# signal: a numpy list of numbers; the audio signal
# sr: the sample rate in Hz, must be an integer
# fxstr: a semicolon-separated string starting with the effect name followed by parameter values in order