# This script allows you to tag vowel intervals occurring within the first 20 mins of each recording. # Specifically, for each successive token, start listening at the beginning of new minute. Then, # take the first usable word that is not in the list of words already represented. form Specify the directory, utterance, and list file. sentence dir D:\CODTemp\ sentence tgdir F:\79510data\ word speaker vita_050705_pt1 word vowel uw positive startMinute 1 positive endMinute 20 endform # Begin by reading in the audio file. Then, checks to see if a TextGrid object exists. # If not, then makes the associated TextGrid object. tgFile$=tgdir$+speaker$+".TextGrid" Open long sound file... 'dir$''speaker$'.wav if fileReadable(tgFile$) Read from file... 'tgFile$' else select LongSound 'speaker$' To TextGrid... "utt word vowel F0F4norm formants" formants endif #Edit the sound file and TextGrid object together, and start tagging the sentences. select LongSound 'speaker$' plus TextGrid 'speaker$' Edit # Determine what the output file name should be where you log # the times and tags for this vowel for this speaker. outFile$=tgdir$+speaker$+"_"+vowel$+".txt" # Loop through each successive minute up to the 20th. for i from 'startMinute' to 'endMinute' # startSecond determines start time, while endSecond determines end time. startSecond=(i-1)*60 endSecond=('startSecond'+60) pause Label and select the next target vowel # Invoke the editor to write the vowel you just tagged # to your log file. editor TextGrid 'speaker$' # Figure out the time of the selected interval in the # vowel tier and the tags for its parents on the word # and utt tiers. st=Get starting point of interval et=Get end point of interval endeditor # Insert the vowel label into the vowel tier. select TextGrid 'speaker$' thisInt=Get interval at time... 3 'st' Set interval text... 3 'thisInt' 'vowel$' wordNo=Get interval at time... 2 'st' wordLab$=Get label of interval... 2 'wordNo' uttNo=Get interval at time... 1 'st' uttLab$=Get label of interval... 1 'uttNo' fileappend "'outFile$'" 'st' 'tab$' 'et' 'tab$''wordLab$' 'tab$' 'uttLab$' 'newline$' print 'wordLab$' 'newline$' # Write the TextGrid object to a TextGrid file. select TextGrid 'speaker$' Write to text file... 'tgFile$' endfor