# deletes content of Praat info window clearinfo # associate the name of the Sound and TextGrid file to a variable name$; concatenate file extension to sound_name$ and text_name$ name$ = "Minimal_Pairs" sound_name$ = name$ + ".wav" text_name$ = name$ + ".TextGrid" # Read in Sound and TextGrid file Read from file: text_name$ Read from file: sound_name$ appendInfoLine: "File", tab$, "Label", tab$, "Duration", tab$, "F1", tab$, "F2", tab$, "F3" selectObject: "Sound " + name$ To Formant (burg): 0, 5, 5500, 0.025, 50 # select the TextGrid file and compute the number of intervals in tier 1 selectObject: "TextGrid " + name$ number_of_intervals = Get number of intervals: 1 for n to number_of_intervals selectObject: "TextGrid " + name$ label$ = Get label of interval: 1, n #if label$ = "a" start = Get start point: 1, n end = Get end point: 1, n duration = (end-start) * 1000 center = (start + end) / 2 selectObject: "Formant " + name$ f1 =Get value at time: 1, center, "Hertz", "Linear" f2 = Get value at time: 2, center, "Hertz", "Linear" f3 =Get value at time: 3, center, "Hertz", "Linear" appendInfoLine: name$, tab$, label$, tab$, fixed$(duration,2), tab$, fixed$(f1,0), tab$, fixed$(f2,0), tab$, fixed$(f3,0) #endif endfor select all Remove