############################################## # measure-duration.praat script # Written by Kyuchul Yoon (kyoon@ling.osu.edu # Measures the durations of objects "Sound" in a particular folder # and writes to an output file ############################################## # Specify files and folders form word inputFileExtension diph word outputFileName duration.txt endform # Get the names of all the input files for loop Create Strings as file list... fileList *.'inputFileExtension$' Sort # Get the number of the files to be used in the loop numFiles = Get number of strings for iFile to numFiles select Strings fileList # Get the name for each file fullFileName$ = Get string... iFile # Read in the file Read from file... 'fullFileName$' # Get the duration of the file dur = Get duration # Write it to the output file fileappend 'outputFileName$' 'fullFileName$''tab$''dur:2''newline$' # Get rid of the file from the Object Editor Remove endfor # Get rid of the Strings object from the Object Editor select Strings fileList Remove #### END OF SCRIPT ####