# deletes content of Praat info window clearinfo # associate the name of the Sound and TextGrid file to a variable name$; concatenate file extension to sound_name$ and text_name$ name$ = "Minimal_Pairs" sound_name$ = name$ + ".wav" text_name$ = name$ + ".TextGrid" # associate the directory to the variable directory$; here commented out because the Praat script is saved in the same directory as the Sound and TextGrid file #directory$ = "/Users/Jeanin/Dropbox/Uni/Lehre/Praat Kurs SoSe 2014/2. Sitzung/" #Read from file: directory$ + text_name$ #Read from file: directory$ + sound_name$ # Read in Sound and TextGrid file Read from file: text_name$ Read from file: sound_name$ # select the TextGrid file and compute the number of intervals in tier 1 selectObject: "TextGrid " + name$ number_of_intervals = Get number of intervals: 1 # print a string which includes the name of the TextGrid analyzed and the number of intervals the TextGrid contains appendInfoLine: "The TextGrid ", name$, " contains ", number_of_intervals, " intervals." start1 = Get start point: 1, 1 end1 = Get end point: 1, 1 duration1 = end1-start1 start2 = Get start point: 1, 2 end2 = Get end point: 1, 2 duration2 = end2-start2 start3 = Get start point: 1, 3 end3 = Get end point: 1, 3 duration3 = end3-start3 appendInfoLine: "The first interval has a duration of ", duration1, " seconds." appendInfoLine: "The second interval has a duration of ", duration2, " seconds." appendInfoLine: "The third interval has a duration of ", duration3, " seconds." # cleaning up... #selectObject: "TextGrid " + name$ #plusObject: "Sound " + name$ select all Remove # or # removeObject: "Sound " + name$ # removeObject: "TextGrid " + name$