我想将wav文件与sox.like这个模板合并:
sox input1.wav input2.wav input3.wav outfile.wav
我想通过python脚本随机输出wavfile:
import os, time, fnmatch, random
fichier = []
file = os.getcwd() + "/*"
p = 0
time.sleep(0.1)
time.sleep(0.1)
for file in os.listdir('.'):
if fnmatch.fnmatch(file, '*.wav'):
fichier.append(file)
p = p + 1
print("nombre de fichiers=> " + str(p))
random.shuffle(fichier)
cmd='sox '+ fichier +' sortie.wav'
print(cmd)
os.system(cmd)
问题是fichier
是一个列表,不能在字符串命令中...
我怎样才能正确地从数组中提取所有文件?