这是我的第一个问题,我尽量说清楚。我浏览了该网站,但没有找到任何可以帮助我的问题。
我试图让 praat 中的发病检测脚本循环整个目录。我已将发病检测脚本作为内循环嵌套到遍历特定库中每个文件的外循环。但是,我似乎无法让它工作。我只得到目录中第一个文件的开头。发病检测脚本本身运行良好,外部循环与其他命令(例如“获取强度”)一起运行良好。谁能看到我做错了什么?
这是我所做的:
form Get Intensity
sentence Directory .\
comment If you want to analyze all the files, leave this blank
word Base_file_name
comment The name of result file
text textfile intensity_VOT_list.txt
endform
#Print one set of headers
fileappend "'textfile$'" File name'tab$'
fileappend "'textfile$'" 'newline$'
Create Strings as file list... wavlist 'directory$'/'base_file_name$'*.wav
n = Get number of strings
for i from 1 to n
select Strings wavlist
filename$ = Get string... i
Read from file... 'directory$'/'filename$'
soundname$ = selected$ ("Sound")
To Intensity... 100 0
labelline$ = "'soundname$''tab$'"
fileappend "'textfile$'" 'labelline$'
select Intensity 'soundname$'
numberOfFrames = Get number of frames
fileappend "'textfile$'" 'numberOfFrames'
fileappend "'textfile$'" 'newline$'
for i from 1 to numberOfFrames
intensity = Get value in frame: i
if intensity > 40
time = Get time from frame: i
onsetresultline$ = "voice onset time for 'soundname$' is 'tab$''time''tab$'"
fileappend "'textfile$'" 'onsetresultline$'
fileappend "'textfile$'" 'newline$'
exit
endif
endfor
endfor
我很乐意提供任何帮助。如果您阅读了我的问题并觉得它的表述很糟糕,请给我反馈,以便我可以尝试变得更好。亲切地