## This script is adapted from Catherine Crosswhite's webpage, and slightly modified by Taehong Cho ## You need sound files in one directory ## This script opens each sound file and a generate a textgrid file (tier 1) ## You can mark intervals and label them ## when you click "next" button (which appears in the small window box), it automatically saves the annotated textgrid file. #### IMPORTANT!1 #### If you run this script again in the same directory, your annotation will be erased!!!!! ## You will have to run this script once for every word in your data set. ## It is set up this way so that all tokens of a given word are marked in succession, ## increasing uniformity across tokens. To specify the word you will work on, just run ## the script. A form will pop up allowing you to specify your directory and the word to work on. ## If you don't want to do it this way, just make sure to leave the "Word" field COMPLETELY BLANK ## when you run the script -- delete any default value displayed there. Then you will go through ## all of the files. ## End of Description # The following four lines are a form, asking for the directory location you want to use. # Note that this form specifies two variables, "Directory" and "Word." Later in the script, # these variables can be referred to as "directory$" and "word$", since they are both string variables. # These lines also specify the default values for each of these variables -- "C:\My Data\" and "cat". Edit # these lines if you want to change the defaults, but be sure not to forget the trailing backslash at # the end of the directory name. form Enter directory and search string sentence Directory \\Nt01\MAC1\Annelie\r sentences\ sentence Word click endform ## Create Strings as file list... file-list 'directory$''word$'*.wav number_of_files = Get number of strings for x from 1 to number_of_files select Strings file-list current_file$ = Get string... x Read from file... 'directory$''current_file$' object_name$ = selected$ ("Sound") To TextGrid... "segments" plus Sound 'object_name$' Edit pause Mark your segments! minus Sound 'object_name$' Write to text file... 'directory$''object_name$'.TextGrid select all minus Strings file-list Remove endfor select Strings file-list Remove print All files processed -- that was fun!