#this is set in place of the form w=2 v=3 o=5 #file names sound_file=do("Open long sound file...", "19_130324_00.WAV") text_file=do("Read from file...", "19_130324.TextGrid") select sound_file plus text_file #this form is currently not in use due to CLI running #form Get tier numbers # comment Please enter your word tier number and vowel measurement tier number # comment w=word tier number (e.g., if word tier is the first tier, then enter 1) # comment v=vowel measurement tier number (e.g., if tier 5, then enter 5) #comment o=number of formants you could like to return in LPC #positive w 2 #positive v 3 #positive o 5 #endform n=numberOfSelected ("LongSound") echo n='n' m=numberOfSelected ("TextGrid") printline m='m' if n!=m exit ERROR!PLEASE MAKE SURE YOU SELECTED THE SAME NUMBER OF SOUND AND TEXTGRID FILES. endif printline printline List of LongSound Files for i from 0 to n-1 longsound'i' = selected ("LongSound", i) printline longsound'i' endfor printline printline List of TextGrid Files for i from 0 to m-1 textgrid'i'=selected("TextGrid",i) printline textgrid'i' endfor printline #sound files loop for i from 0 to n-1 printline textgrid'i' Measurements: printline ======================================== printline Speaker 'tab$' Vowel 'tab$' Word 'tab$' msduration 'tab$' start 'tab$' f1 'tab$' f2 'tab$' f3 'tab$' f1_20 'tab$' f2_20 'tab$' f3_20 'tab$' f1_80 'tab$' f2_80 'tab$' f3_80 select longsound'i' total_duration=Get total duration total_end=Get end time #p is the length of extraction p=600 #q is number of times for loop q=total_duration div p #r is the rest of the duration #r=total_duration mod p j=1 #extract the first n-1 parts, where n is the total no. of parts #within one longsound file, use this loop to extract parts into sound obj. for k from 0 to q-1 printline 'k'-th extraction starting... select longsound'i' extraction=Extract part... 0+k*600 600+k*600 yes #get the start/end of this extraction ext_start=Get start time ext_end=Get end time formant_obj=To Formant (burg)... 0.0 o 5500 0.025 50 #compute the values for this part call ComputeFormant ext_start ext_end select extraction printline ===================================================== printline removing sound_obj... Remove endfor #the last extraction printline performing last round of extraction... last_start=ext_end last_end=total_end select longsound'i' extraction=Extract part... last_start last_end yes #get the start/end of this extraction ext_start=Get start time ext_end=Get end time formant_obj=To Formant (burg)... 0.0 o 5500 0.025 50 call ComputeFormant ext_start ext_end select extraction printline removing sound_obj... Remove endfor #end of main method==================================================== procedure ComputeFormant ext_start ext_end select textgrid'i' start=Get start point... v j printline start iterating through textgrid... #loop each interval while (start>ext_start or start=ext_start) and start