#! praat # # Inspect Sound files with their label files # Ask for directories and wild-cards # # (default: current directory) form files to inspect word soundDirectoryName ./Fragments/Speech/ word labelDirectoryName ./Fragments/Labels/ word filePattern * endform # Handle default (current) directory if soundDirectoryName$ = "." soundDirectoryName$ = "" endif if labelDirectoryName$ = "." labelDirectoryName$ = "" endif # Read all filenames Create Strings as file list... list 'soundDirectoryName$''filePattern$'* Rename... soundList numberOfFiles = Get number of strings Create Strings as file list... list 'labelDirectoryName$''filePattern$'* Rename... labelList # Warn the user if numberOfFiles < 1 clearinfo printline No files were found for: printline 'soundDirectoryName$''filePattern$' printline printline (if the pattern is correct, there might be too many matching files) endif # Iterate over all recording sound files for ifile to numberOfFiles select Strings soundList fullSoundFileName$ = Get string... ifile select Strings labelList fullLabelFileName$ = Get string... ifile Read from file... 'soundDirectoryName$''fullSoundFileName$' Rename... Sound Read from file... 'labelDirectoryName$''fullLabelFileName$' Rename... Label plus Sound Sound Edit # Wait for reaction select Strings soundList nextFileName$ = Get string... ifile + 1 pause Next file: 'nextFileName$' or stop # Remove rubish select Sound Sound plus TextGrid Label Remove endfor