如何自动从PRAAT的.wav文件中提取音高范围并将其全部放入.csv文件中?

时间:2019-12-16 12:25:27

标签: audio audio-processing pitch praat audio-analysis

我正在使用PRAAT,我需要提取音高范围。我的音频文件都不到2秒,我有十几个。我仅知道在单击时获得信息。现在,我从单击原始音频文件上的“提取可见音高轮廓”后,从获得的音高对象中手动提取音高范围(“查询”>“音高信息”)。

1 个答案:

答案 0 :(得分:0)

此脚本将为您将目录中所有.wav文件的音调范围记录到csv文件中。确保在路径的末尾加上斜线。

form Enter Full Path + \
sentence path C:\
endform

filedelete 'path$''name$'pitch_range.csv
header_row$ = "Filename" + tab$ + "Mean F0" + tab$ + "mean SD"  + tab$ + "min pitch" + tab$ + "max pitch" + newline$
header_row$ > 'path$'pitch_range.csv

Create Strings as file list...  list 'path$'*.wav
number_files = Get number of strings
for j from 1 to number_files
   select Strings list
   current_token$ = Get string... 'j'
   Read from file... 'path$''current_token$'
   To Pitch (ac)... 0.01 75 15 no 0.03 0.45 0.01 0.35 0.14 600 
   minpitch = Get minimum... 0 0 Hertz Parabolic
   maxpitch = Get maximum... 0 0 Hertz Parabolic
   range = maxpitch - minpitch
   fileappend "'path$'pitch_range.csv" 'current_token$' 'tab$' 'range:4' 'newline$'
   Remove
endfor