# 本脚本对某个目录下面所有文件夹中的声音文件,使用Praat自带的ToTextGrid(Silence)功能进行分段,然后按照文件名进行标注,并另存 # Written by Qibin Ran (ranqibin@126.com) # 2021-10-03 # 使用或引用请注明 form 声音文件首尾端点确定并标注脚本 comment 原始声音文件所在的文件夹地址 text input_Directory E:\0语言学 endform if right$(input_Directory$,1)<>"\" input_Directory$=input_Directory$+"\" endif Create Strings as directory list... direcList 'input_Directory$' numberOfDirecs = Get number of strings for iDirec from 1 to numberOfDirecs select Strings direcList direcName$ = Get string... 'iDirec' wdirecName1$ = input_Directory$ + direcName$ wdirecName$ = wdirecName1$ + "\" Create Strings as file list... fileList 'wdirecName$'*.wav numberOfFiles = Get number of strings for ifile from 1 to numberOfFiles select Strings fileList fileName$ = Get string... 'ifile' simpName$ = fileName$ - ".wav" Read from file... 'wdirecName$''fileName$' select Sound 'simpName$' To TextGrid (silences)... 100 0.0 -25.0 0.1 0.1 "" 'simpName$' select TextGrid 'simpName$' Write to text file... 'wdirecName$''simpName$'.TextGrid Remove plus Sound 'simpName$' Remove endfor select Strings fileList Remove endfor select all Remove exit OK!所有文件夹里的声音文件已经自动标注并保存!