################################################## ## 本脚本批量提取某文件夹中所有声音文件的嗓音 ## ## Jitter和Shimmer数据,另存为文本文件。 ## ## 本脚本只报告声音文件中有基频数据部分的嗓音 ## ## 情况。 ## ## Written by Qibin Ran (ranqibin@126.com) ## ## 2019-06-25 ## ################################################## form 设定声音文件所在的文件夹地址 comment 请输入声音文件所在的文件夹地址 text soundpath C:\Users\ran\Desktop\test\ endform if right$(soundpath$,1)<>"\" soundpath$ = soundpath$+"\" endif Create Strings as file list... fileList 'soundpath$'*.wav numOfFiles = Get number of strings for ifile to numOfFiles select Strings fileList fileName$ = Get string... 'ifile' Read from file... 'soundpath$''fileName$' sName$ = fileName$ - ".wav" To Pitch... 0 75 600 n = Get number of frames for i to n pitch1 = Get value in frame: i, "Hertz" if pitch1 <> undefined time1 = Get time from frame: i i = n + 1 endif endfor for ii to n x = n + 1 -ii select Pitch 'sName$' pitch2 = Get value in frame: x, "Hertz" if pitch2 <> undefined time2 = Get time from frame: x ii = n + 1 endif endfor select Pitch 'sName$' Remove select Sound 'sName$' View & Edit editor Sound 'sName$' Show analyses... yes yes no yes yes 10 Select... time1 time2 Voice report endeditor fappendinfo 'soundpath$'temp.txt Remove endfor Read Strings from raw text file... 'soundpath$'temp.txt numOfString = Get number of strings for i to numOfString x = (i-1)*40 + 25 y = x + 6 text1t$ = Get string... 'x' jitterv = extractNumber(text1t$,":") fileappend 'soundpath$'Jitter.txt 'jitterv''newline$' text2t$ = Get string... 'y' shimmerv = extractNumber(text2t$,":") fileappend 'soundpath$'Shimmer.txt 'shimmerv''newline$' endfor select all Remove exit 所有声音文件的嗓音报告Jitter和Shimmer数据已经存储!