【KAWAKO】Pydub-某些函数的使用方法
EQ
源码
-
seg:AudioSegment音频
-
focus_freq:需要调整的中心频率
-
bandwidth:调整的频率范围
-
channel_mode:调整哪个声道
-
filter_mode::滤波器种类。“peak”带通,“low_shelf”对低频做处理,“high_shelf”对高频做处理
-
gain_dB:处理的增益大小
-
order:暂时没看懂什么意思,保持默认的2就好
其中使用的_eq函数源码
测试代码
抑制高频和低频,略微拉升中频,模拟电话音色。
from pydub import AudioSegment, scipy_effects
sound=AudioSegment.from_file("common_voice_zh-CN_22770707.wav","wav")
gain = -1.5
aaa = scipy_effects.eq(sound, 500, filter_mode="low_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 500, filter_mode="low_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 3500, filter_mode="high_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 3500, filter_mode="high_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 500, filter_mode="low_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 500, filter_mode="low_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 3500, filter_mode="high_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 3500, filter_mode="high_shelf", gain_dB=gain, order=2)
aaa = scipy_effects.eq(aaa, 2000, 1500, filter_mode="peak", gain_dB=5, order=2)
aaa.export("qaq测试语音大小(6).wav","wav")
版权声明:
本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自
KAWAKO!
喜欢就支持一下吧
打赏
微信
支付宝