目录

EQ

源码

其中使用的_eq函数源码

测试代码


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")

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐