# tagvowels.praat # # Created July 2006 for Ling 795.10 course ... # # Script to loop through and place boundary markers around # the vowels (and also a steady state tag?) in all of the # wav files in some directory where you have unzipped one # or more of the three collections of audio recordings from # the Hillenbrand et al. 1995 URL: # # http://homepages.wmich.edu/~hillenbr/voweldata.html # # which has the wav files, measurements, listening data in: # # Hillenbrand, James, Laura A. Getty, Michael J. Clark & # Kimberlee Wheeler (1995). Acoustic characteristics of # American English vowels. Journal of the Acoustical Society # of America, 97, 3099-3111. # # Form to prompt the user to specify variables for the # directories where the wav files are stored and where you # want the TextGrid files to go (you might want to edit these # path names directly in the script instead of specifying # them each time if they are different from the defuault) and # also the talker to tag. form Specify directory and talker sentence dir C:\Lx286\Hillenbrand\kids\ sentence tgDir C:\795.10su2006\TextGrids\ word talker b01 endform # Make a Strings object that lists all files in the directory # named by the dir$ variable that begin with the talker$ # variable and end with the .wav extension. Count the number # of strings and set the variable numFiles to that number. Create Strings as file list... fileList 'dir$''talker$'*.wav numFiles=Get number of strings # Refer to the value of numFiles in this loop through the # all of the strings in the Strings object called fileList for i from 1 to 'numFiles' # Retrieve the ith string from fileList and set the # variable fileName$ to that string. select Strings fileList fileName$=Get string... i # Read in the file named by the string and check to # see if a TextGrid exists. If it does not, create # one with an interval tier to demarcate the vowel # and a points tier to tag the steady state. Read from file... 'dir$''fileName$' utt$=fileName$-".wav" tgFile$=tgDir$+utt$+".TextGrid" if fileReadable(tgFile$) Read from file... 'tgFile$' print Successfully read TextGrid file for 'utt$''newline$' else select Sound 'utt$' To TextGrid... "vowel steadystate" steadystate print Created new TextGrid object for 'utt$''newline$' endif select Sound 'utt$' plus TextGrid 'utt$' Edit # Spectrogram settings... 0 4000 0.005 40 # Formant settings... 7200 7 0.016 30 1 pause... Mark the boundaries for the vowel and so on Write to text file... 'tgFile$' endfor