1

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

4

1 回答 1

1

此脚本将为您将目录中所有 .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
于 2020-02-13T20:30:36.327 回答