批量转换目录下音频格式的

2015-11-30 0 994
批量转换目录下音频格式的
##
import os;
def fa(dir):
	dst_dir = os.getcwd() + '/mp3/';
	lists = os.walk(dir);
	for root, dirs, files in lists:
		for file in files:
			pix = os.path.splitext(file);
			if 'amr' == pix[1][1:]:
				dst_file = dst_dir + pix[0] + '.mp3';
				src_file = root + '/' + file;
				cmd = 'ffmpeg -i ' + src_file + ' ' + dst_file;
				os.system(cmd)
	print('ok');

fa('/root/python/amr');

遇见资源网 python 批量转换目录下音频格式的 http://www.ox520.com/16002.html

上一篇: 解密
常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务