【KAWAKO】Pydub-某些函数的使用方法
目录EQ源码其中使用的_eq函数源码测试代码EQ源码seg:AudioSegment音频focus_freq:需要调整的中心频率bandwidth:调整的频率范围channel_mode:调整哪个声道filter_mode::滤波器种类。“peak”带通,“low_shelf”对低频做处理,“high_shelf”对高频做处理gain_dB:处理的增益大小order:暂时没看懂什么意思,保持默认的
·
目录
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")
更多推荐
已为社区贡献1条内容
所有评论(0)