Skip to content

Instantly share code, notes, and snippets.

@sveitser
Last active April 9, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sveitser/aa95f9df7a0a5d8f7f678d681f9da12f to your computer and use it in GitHub Desktop.
Save sveitser/aa95f9df7a0a5d8f7f678d681f9da12f to your computer and use it in GitHub Desktop.
pydub de-esser / bandstop filter
# pip install pydub scipy
import pydub.scipy_effects
from pydub import AudioSegment
from pydub.playback import play
raw = AudioSegment.from_wav("blah.wav")
six = pydub.scipy_effects.low_pass_filter(raw, 6000, order=1)
play(raw)
play(six)
# six._data
def bandstop(seg, low, high, order=2):
filter_fn = pydub.scipy_effects._mk_butter_filter([low, high], 'bandstop', order=order)
return seg.apply_mono_filter_to_each_channel(filter_fn)
def de_esser(seg):
return bandstop(raw, 8000, 10000, order=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment