##################################################################### ### ToBI_TextGrid_maker.praat ### ### Opens sound files annotating them to TextGrid with the 4 ToBI tiers ### ### Rafèu Sichel-Bazin ### April 2009 ### ### Praat version: 5.0.09 ##################################################################### form Input directory name # comment Enter parent directory where soundfiles are kept: sentence soundDir C:\wav # comment Enter parent directory where TextGrid files are to be kept: sentence textDir C:\textgrid endform # Create list of .wav files in SoundDir Create Strings as file list... list 'soundDir$'\*.wav # loop that goes through all files in the list numberOfFiles = Get number of strings for ifile to numberOfFiles # performs steps for each item in list, one-by-one select Strings list sound_file$ = Get string... ifile # strips file extension to get basename (e.g., basename foo from foo.wav) baseName$ = sound_file$ - ".wav" # Read in the current file Read from file... 'soundDir$'\'baseName$'.wav # creates a ToBI TextGrid for the current file To TextGrid... "Orthograph Phonetics Phrasing Tones" Phrasing Tones # opens the sound file and the corresponding TextGrid select Sound 'baseName$' plus TextGrid 'baseName$' Edit pause Edit TextGrid, then click "Continue" to save TextGrid # save TextGrid file select TextGrid 'baseName$' Write to text file... 'textDir$'\'baseName$'.TextGrid # Cleaning up Objects before strating with a new file select Sound 'baseName$' plus TextGrid 'baseName$' Remove endfor ###### After you're done with all files, remove Strings object for complete object cleaning up select Strings list Remove ######################################################## ## END OF SCRIPT ########################################################