#! praat # # Script to replay the collection of examples in the # logFile.txt as stored in the log/ directory # form Please indicate test directory sentence TestDir log endform clearinfo logPerformance = 0 printline 'testDir$'/*.wav Create Strings as file list... DirList 'testDir$'/*.wav numberOfFiles = Get number of strings for i from 1 to numberOfFiles select Strings DirList testFile$ = Get string... 'i' # Split filename pinyinEnd = index(testFile$, "_") - 1 pinyin$ = left$(testFile$, pinyinEnd) # Start the recognizer execute SGC_PronProt.praat "'testDir$'/'testFile$'" 'pinyin$' 'logPerformance' result$ < lastResult.txt result$ = replace_regex$(result$, "[\n]", " ", 0) printline 'result$' # pause 'result$' endfor select Strings DirList Remove