在Python 3.6上使用os.system调用传递参数

问题描述 投票:1回答:1

我想砍的音频文件分成相等20秒件,并想重新命名我怎样才能达到这个输出文件作为fname0.wav,fname1.wav等?使用下面我得到的错误:

enter image description here

python-3.x ffmpeg
1个回答
1
投票

我跑测试的有关ffmpeg和这工作:

cmd2 = "ffmpeg -i %s -f segment -segment_time 20 -c copy %s" %(file, fname) + "%09d.wav"
os.system(cmd2)

你离开“%09d.wav”,因为它是和把它放在字符串的结尾,格式之外。

© www.soinside.com 2019 - 2024. All rights reserved.