python,sox)为什么我无法减小音量?

时间:2018-10-30 10:06:28

标签: python volume sox

我使用以下语法来减少音量:

sox -v 0.7 in.wav out.wav

我编写了此函数。

def reduce_volume(path):
    folders = glob.glob(path+'*')
    print "folders", folders

    setvolume = 0.7 #70% volume of the original

    for folder in folders:
        files = glob.glob(folder + '/' + '*.wav')
        print "files", files
        if len(files) == 0:
            return 10

        for file in files:
            print file
            original = file

            newname = "_" + str(int(setvolume*100)) + "%" + ".wav"
            reducedname = file.replace('.wav', newname)
            print reducedname

            subprocess.call(['sox', '-v', setvolume, original, reducedname])

但是我得到了这个result

为什么此功能不起作用?

非常感谢您的帮助。

0 个答案:

没有答案