Pydub - How to change frame rate without changing playback speed

删除回忆录丶 提交于 2020-01-02 05:43:46

问题


I have a couple audio files that I open in Pydub with AudioSegment.

I want to decrease the audio quality from frame rate 22050 to 16000 Hz. (One channel files)

If I simply change the frame rate of AudioSegment, what I get is the exact same wave played in slower speed. Well, fair enough.

But how do I actually change the waves to fit a lower quality, same speed playback?

(Manual interpolation is the only thing I can think of, but I don't want to get into that trouble)


回答1:


You can use:

sound = AudioSegment.from_file(…)
sound = sound.set_frame_rate(16000)


来源:https://stackoverflow.com/questions/44035217/pydub-how-to-change-frame-rate-without-changing-playback-speed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!