Python转换音频采样率(8k到16k)
·
# encoding: utf-8
'''
@file: 8convert16.py
@time: 2022/10/19
@author: zpj
'''
import os
import subprocess
# 添加文件输入输出路径
input_path = " "
output_path = " "
for file in os.listdir(input_path):
file1 = input_path + file
file2 = output_path + file
cmd = "ffmpeg -i " + file1 + " -ar 16000 " + file2 #ffmpeg -i 输入文件 -ar 采样率 输出文件
subprocess.call(cmd, shell=True)
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)