Skip to content

使用avec2013.conf配置文件进行音频特征提取,为什么提取到的单个特征文件只包含一个样本?(音频平均时长为10分钟) #80

@IT-xun

Description

@IT-xun

dir_name = 'D:/Projects/vscode/depression_detection/WAV_1'#省略第二个扬声器后的音频文件
out_dir = 'D:/Projects/vscode/depression_detection/WAV_features'

for subdir, dirs, files in os.walk(dir_name):
for file in files:
if file.endswith('.wav'):
input_filepath = os.path.join(subdir, file).replace("\", "/")
partic_id = os.path.basename(subdir)
sample_dir = os.path.join(out_dir, partic_id).replace("\", "/")
if not os.path.exists(sample_dir):
os.makedirs(sample_dir)
os.chdir(sample_dir)
instname = os.path.splitext(file)[0]
outfilepath = sample_dir + '/' + instname + '.csv'

        #opensmile command
        opensmile_call = 'SMILExtract'+' '+'-C'+' '+'D:/opensmile-3.0-win-x64/config/avec11-14/avec2013.conf'+' '+'-I'+' '+input_filepath+' '+'-csvoutput'+' '+outfilepath
        #'SMILExtract -C config/avec11-14/avec2013.conf -I 300_AUDIO.WAV -csvoutput 300_AUDIOtest.csv'
        os.system('cd D:\\opensmile-3.0-win-x64\\bin && ' + opensmile_call)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions