Last active
April 9, 2019 13:41
-
-
Save sveitser/aa95f9df7a0a5d8f7f678d681f9da12f to your computer and use it in GitHub Desktop.
pydub de-esser / bandstop filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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