3 # TestToneRecognition reads all audio-files in a
4 # source directory and tries to recognize them.
6 # The filenames should be:
7 # <pinyin corr>_<transcription>_<height Hz>_...wav
9 form Where are the files
10 sentence dir ../../test
14 exampleChoice$ = "none"
20 Create Strings as file list... fileList 'dir$'/'files$'
22 number_of_files = Get number of strings
24 for i from 1 to number_of_files
25 select Strings fileList
26 currentFile$ = Get string... 'i'
28 pinyin$ = replace_regex$(currentFile$, "^([^_]+)_.*$", "\1", 0)
29 result$ = replace_regex$(currentFile$, "^[^_]+_([^_]+)_.*$", "\1", 0)
30 height$ = replace_regex$(currentFile$, "^[^_]+_[^_]+_([^_]+)_.*$", "\1", 0)
31 if index_regex(height$, "^F") > 0
33 elsif index_regex(height$, "^M") > 0
38 # Take the correct boundaries between genders
49 execute SGC_ToneProt.praat "'dir$'/'currentFile$'" 'pinyin$' 'currentRegister' 'precision' 'exampleChoice$' 'logPerformance'
51 result$ < lastResult.txt
52 result$ = replace_regex$(result$, "[\n]", " ", 0)
53 printline 'result$''tab$''currentFile$'