# ChopUtterances.praat form Parameters word inFolder rest endform Create Strings as file list... fileListObj 'inFolder$'/*.wav Sort numFiles = Get number of strings processedFolder$ = "done" for iFile to numFiles select Strings fileListObj fileName$ = Get string... iFile prefix$ = fileName$ - ".wav" Read from file... 'inFolder$'/'fileName$' Rename... soundObj To TextGrid... sentence Rename... textObj plus Sound soundObj Edit i=0 dur = 1 while dur>0 i=i+1 j=i*2 editor TextGrid textObj pause Pick your sentence. SINGLE-CLICK anywhere when all done. start = Get start of selection end = Get end of selection dur = end - start endeditor if dur>0 select TextGrid textObj Insert boundary... 1 start Insert boundary... 1 end if i=1 Set interval text... 1 j The dancing queen likes only the apple pies. name$ = "sentence1-" + fileName$ subFolder$ = "sentence1.TheDancingQueen" elsif i=2 Set interval text... 1 j The players sent the cap to Susan. name$ = "sentence2-" + fileName$ subFolder$ = "sentence2.ThePlayersSentTheCap" elsif i=3 Set interval text... 1 j People couldn't sleep well last night because of the noise. name$ = "sentence3-" + fileName$ subFolder$ = "sentence3.PeopleCouldntSleepWell" elsif i=4 Set interval text... 1 j When did he go skiing, Wednesday or Thursday? name$ = "sentence4-" + fileName$ subFolder$ = "sentence4.WhenDidHeGoSkiing" elsif i=5 Set interval text... 1 j I see the moon shining brightly all over the lake. name$ = "sentence5-" + fileName$ subFolder$ = "sentence5.ISeeTheMoonShining" elsif i=6 Set interval text... 1 j How long does it take to the next bus stop? name$ = "sentence6-" + fileName$ subFolder$ = "sentence6.HowLongDoesItTake" elsif i=7 Set interval text... 1 j Thirteen years later, Mary met him at the same place. name$ = "sentence7-" + fileName$ subFolder$ = "sentence7.ThirteenYearsLaterMary" elsif i=8 Set interval text... 1 j If a tree could talk, what would it say? name$ = "sentence8-" + fileName$ subFolder$ = "sentence8.IfATreeCouldTalk" endif select Sound soundObj Extract part... start end rectangular 1 no Rename... 'name$' Write to WAV file... 'inFolder$'/'subFolder$'/'name$' Remove endif endwhile select Sound soundObj Write to WAV file... 'inFolder$'/'processedFolder$'/'fileName$' Remove filedelete 'inFolder$'/'fileName$' select TextGrid textObj Write to text file... 'inFolder$'/'processedFolder$'/'prefix$'.TextGrid Remove endfor