音频处理2

我要开发同款
proginn22445864022023年07月03日
66阅读
开发技术python

作品详情

from pydub import AudioSegmentimport ospath = r'D:\Users\Downloads\10 Music\music2023'filename_output = Nonefile_input = Nonefor filename in os.listdir(path): # filename = r'愿与愁.wav' if filename.endswith(".wav"): file_input = path + '\\' + filename print(file_input) filename_output = filename.replace(".wav", ".flac") # file_output = path + '\\' + filename_output # song = AudioSegment.from_wav(file_input) # song.export(file_output, format="flac") elif filename.endswith(".ape"): file_input = path + '\\' + filename print(file_input) filename_output = filename.replace(".ape", ".flac") if filename_output is not None and file_input is not None: file_output = path + '\\' + filename_output song = AudioSegment.from_file(file_input) song.export(file_output, format="flac")
查看全文
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论