þÿ# tokenizeWords.praat form Parameters word inFolder notLabeled word subFolder sentence8.IfATreeCouldTalk word processedFolder byWord endform # For sentence 1: The dancing queen likes only the apple pies. word0$ = "<SIL>" numWords = 10 word1$ = "If" word2$ = "a" word3$ = "tree" word4$ = "could" word5$ = "talk," word6$ = "<SIL>" word7$ = "what" word8$ = "would" word9$ = "it" word10$ = "say?" Create Strings as file list... fileListObj 'inFolder$'/'subFolder$'/*.wav Sort numFiles = Get number of strings # Loop through all the sentence 1 files for iFile to numFiles select Strings fileListObj fileName$ = Get string... iFile prefix$ = fileName$ - ".wav" Read from file... 'inFolder$'/'subFolder$'/'fileName$' Rename... soundObj To TextGrid... word Rename... textgridObj plus Sound soundObj Edit # Identify the word boundaries playPointLeft = 0 for iWord from 0 to numWords intervalNum = iWord + 1 dummy$ = word'iWord'$ pause Click the boundary and press Continue editor TextGrid textgridObj cursor = Get cursor endeditor select TextGrid textgridObj Insert boundary... 1 cursor Set interval text... 1 intervalNum 'dummy$' editor TextGrid textgridObj Play... playPointLeft cursor endeditor playPointLeft = cursor select TextGrid textgridObj endfor select TextGrid textgridObj Set interval text... 1 (intervalNum+1) <SIL> Write to text file... 'inFolder$'/'subFolder$'/'processedFolder$'/'prefix$'.TextGrid Remove select Sound soundObj Write to WAV file... 'inFolder$'/'subFolder$'/'processedFolder$'/'fileName$' Remove filedelete 'inFolder$'/'subFolder$'/'fileName$' endfor select Strings fileListObj Remove ########## END OF SCRIPT ############