#This script opens all .wav and .TextGrid files in a folder #(path to be specified at the beginning) and measures #the f1 and f2 values (ERB) at a time marked by a point boundary #in the TextGrid. It puts the retrieved information #in the info window and also writes it in a text file, #along with name of file and boundary label. # #In this script, tier 1 is the point tier containing the labels. # #Created by Jessica Sertling Miller - sertling@uiuc.edu #with help from Tae-Jin Yoon - tyoon@uiuc.edu #November 10, 2005 ########################################################################### form Get formant values comment source directory text sourceDir endform clearinfo Create Strings as file list... list 'sourceDir$'/*.wav all = Get number of strings for ifile to all select Strings list soundname$ = Get string... ifile name$ = soundname$ - ".wav" gridname$ = name$ + ".TextGrid" Read from file... 'sourceDir$'/'soundname$' Read from file... 'sourceDir$'/'gridname$' select Sound 'name$' To Formant (burg)... 0 5 5500 0.025 50 select TextGrid 'name$' np1 = Get number of points... 1 for i to np1 select TextGrid 'name$' time = Get time of point... 1 i vowelLabel$ = Get label of point... 1 i select Formant 'name$' f1 = Get value at time... 1 time Hertz Linear f2 = Get value at time... 2 time Hertz Linear fileappend "formants.txt" 'soundname$' 'vowelLabel$' 'f1' 'f2''newline$' printline 'name$' 'vowelLabel$' 'f1' 'f2' endfor select all minus Strings list Remove endfor select Strings list Remove