######################################### ### Calculation of durations ### adapted by Pauline Welby from ### Ben Munson's "the world's simplest Praat script" ### May 2, 2002 ### Does calculation for all specified files ########################################## #read in specified files form Input directory name without final slash word dirName /win/hda1/data/sp02 endform # read in all files in the directory 'dirName$' Create Strings as file list... list 'dirName$'/ss-f1-*.wav #directory$ = "SP02" # Replace above line with below line to read from a text file listing filenames # Read Strings from raw text file... 'directory$'/foo.txt numberOfFiles = Get number of strings for ifile to numberOfFiles select Strings list fileName$ = Get string... ifile Read from file... 'dirName$'/'fileName$' endfor Edit # calculate durations, print as a table to info window clearinfo #for line from 1 to numberOfFiles for line from 1 to numberOfFiles select all name$ = selected$ ("Sound", line) select Sound 'name$' dur = Get duration dur2 = 1000*dur print 'name$' printtab