4 # Intializing Praat script
6 # SpeakGoodChinese: InitializeSGC2.praat defines and sets the global variables
7 # and loads general SGC2 code
9 # Copyright (C) 2007-2010 R.J.J.H. van Son and 2010 the Netherlands Cancer Institute
10 # The SpeakGoodChinese team are:
11 # Guangqin Chen, Zhonyan Chen, Stefan de Koning, Eveline van Hagen,
12 # Rob van Son, Dennis Vierkant, David Weenink
14 # This program is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of the License, or
17 # (at your option) any later version.
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write to the Free Software
26 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
29 # Do not store these variables as preferences
30 sgc.nonPreferences$ = " config.savePerf config.openPerf config.clearSummary config.audioName "
32 # Information for logging
33 currentDate$ = date$()
34 dateYear$ = right$(currentDate$, length(currentDate$) - rindex(currentDate$, " "))
35 logtimeStamp$ = replace_regex$(currentDate$, "[^a-zA-Z0-9\-_]", "-", 0)
36 currentLogDirectory$ = ""
37 feedbackTablePrefix$ = "Feedback"
38 feedbackTableName$ = ""
39 evaluationTablePrefix$ = "Evaluation"
40 evaluationTableName$ = ""
41 performanceTableName$ = "Performance"
46 yFeedback = yWordlist + 5
47 yPinyin = yFeedback + 10
48 yContour = yPinyin + 15
49 wipeContourArea$ = "demo Paint rectangle... White 20 80 'yContour' 100"
50 wipePinyinArea$ = "demo Paint rectangle... White 20 80 'yPinyin' 'yContour'"
51 wipeFeedbackArea$ = "demo Paint rectangle... White 0 100 'yFeedback' 'yPinyin'"
52 wipeWordlistArea$ = "demo Paint rectangle... White 20 80 'yWordlist' 'yFeedback'"
54 # Pop-Up window colors
55 sgc2.popUp_bordercolor$ = "{0.5,0.5,1}"
56 sgc2.popUp_backgroundcolor$ = "{0.9,0.9,1}"
58 # Initialize parameters
73 sgc.failedAttempts = 0
75 config.deleteWordlist = -1
76 config.displayNumbers = 1
77 config.displayPinyin = 1
78 config.displayChar = 0
79 config.displayTrans = 1
80 config.useSoundExample = 1
81 config.synthesis$ = "_DISABLED_"
82 config.input$ = "Microphone"
83 config.showBackground = 1
84 sgc2.noiseThresshold = -30
89 config.clearSummary = 0
90 config.audioName$ = ""
93 mainPage.saveAudio$ = ""
96 sgc_ToneProt.minimumPitch = 40
97 sgc_ToneProt.maximumPitch = 600
99 # Platform dependent settings
100 if macintosh or windows
101 config.displayChar = 1
102 config.displayNumbers = 0
104 if windows and endsWith(build_SHA$, " XP")
105 config.displayChar = 0
106 config.displayNumbers = 0
109 config.displayChar = 0
110 config.displayNumbers = 1
114 samplingFrequency = 44100
116 samplingFrequency = 44100
118 samplingFrequency = 44100
123 config.language$ = "EN"
124 config.register = 249
125 preferencesAppFile$ = preferencesAppDir$+"/sgc2rc.txt"
126 preferencesLogDir$ = "'preferencesAppDir$'/log"
127 preferencesTableDir$ = "'preferencesAppDir$'/Data"
128 sgc2wordlists$ = "'preferencesAppDir$'/wordlists"
129 localWordlistDir$ = sgc2wordlists$
131 # Global word lists must be installed BY THE ADMINISTRATOR
132 # This means, create the directory 'globalwordlists$' and
133 # fill it with wordlist directories containing wordlist.Table
134 # and audio files. They can be copied from a local directory.
135 globalwordlists$ = ""
136 globaltablelists$ = ""
139 globalwordlists$ = "/etc/'sgc2.demoAppName$'/wordlists"
140 globaltablelists$ = "/etc/'sgc2.demoAppName$'/Data"
141 globalTTSdir$ = "/etc/'sgc2.demoAppName$'/TTS"
143 globalwordlists$ = "/Library/Preferences/'sgc2.demoAppName$'/wordlists"
144 globaltablelists$ = "/Library/Preferences/'sgc2.demoAppName$'/Data"
145 globalTTSdir$ = "/Library/Preferences/'sgc2.demoAppName$'/TTS"
147 globalwordlists$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/wordlists"
148 globaltablelists$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/Data"
149 globalTTSdir$ = "C:/Documents and Settings/All Users/Application Data/'sgc2.demoAppName$'/TTS"
151 sgc2.synthesizer = -1
152 # Define a Praat TTS command that will set sgc2.synthesizer
153 sgc2.normalTTScommand$ = "call create_default_TTS Mandarin f4 10000 0.01 50 100 95 no IPA"
154 sgc2.advancedTTScommand$ = "call create_default_TTS Mandarin f4 10000 0.01 50 70 125 no IPA"
155 sgc.alignedTextGrid = -1
157 ##############################################################
159 config.shuffleLists = 1
160 config.adaptiveLists = 0
162 defaultFont$ = "Helvetica"
165 # Set up directories if they do not exist already
166 call set_up_directories
168 # Get saved preferences
169 call read_preferences ""
172 speakCommandDir$ = "'preferencesAppDir$'/TTS"
173 speakCommandFile$ = ""
175 sgc.recordCommandFile$ = ""
176 sgc.playCommandFile$ = ""
178 sgc.scratchAudioDir$ = "'preferencesAppDir$'\audio\"
180 sgc.scratchAudioDir$ = "/tmp/SpeakGoodChinese/"
182 sgc.useAlternativeRecorder = 0
184 sgc.useAlternativePlayer = 0
187 # Set inital language
188 call set_language 'config.language$'
191 call load_word_list "'localWordlistDir$'" 0
193 # Set up evaluation table
194 initialiseSGC2.toneevaluation_table$ = ""
195 call initialize_toneevaluation_tables
200 ###############################################################
202 # Obligatory procedures
204 ###############################################################
205 # Initialize Demo Window
206 procedure init_window
208 demo Line width... 'defaultLineWidth'
210 call set_font_size 'defaultFontSize'
213 # If there is no recorded sound, try to read stored recording
214 if recordedSound$ = "" and sgc.saveAudio$ <> ""
216 select Table 'wordlist$'
217 if sgc.currentWord > 0 and sgc.currentWord <= sgc.numberOfWords
218 call readPinyin 'sgc.currentWord'
219 sgc.pinyin$ = readPinyin.pinyin$
220 .outputName$ = "'sgc.saveAudio$'/'sgc.pinyin$'.wav"
221 if fileReadable(.outputName$)
222 sgc.recordedSound = Read from file: .outputName$
223 recordedSound$ = selected$("Sound")
225 # See feedback on earl;ier recorded words
226 if fileReadable("'sgc.saveAudio$'/TestSpeakGoodChinese2.txt")
227 call write_feedback Feedback
229 select Table Feedback
232 # Set config.audioName
233 .tmp$ = replace_regex$(sgc.saveAudio$, "[^/\\]+[/\\]?$", "", 0)
234 config.audioName$ = replace$(sgc.saveAudio$, .tmp$, "", 0)
240 # Set mainPage.saveAudio$ grade
241 call set_grade_display 'sgc.pinyin$'
245 .windowTitle$ = replace$(wordlistName$, "_", " ", 0)
246 call set_window_title 'buttons$' '.windowTitle$'
247 # Display the word-list
249 # Wipe screen and draw background
250 call wipeArea 'wipeContourArea$'
251 if config.showBackground
252 call draw_background Background
254 # Define buttons in a table
260 call draw_tone_contour
262 call paint_saveAudio_light
265 sgc.failedAttempts = 0
268 # Make sure all Preferences directories are available
269 procedure set_up_directories
270 .dirPath$ = "'preferencesAppDir$'"
271 createDirectory(.dirPath$)
272 .dirPath$ > '.dirPath$'/directory.txt
273 createDirectory("'.dirPath$'/wordlists")
274 .dirPath$ > '.dirPath$'/wordlists/directory.txt
275 createDirectory("'.dirPath$'/pitchmodels")
276 .dirPath$ > '.dirPath$'/pitchmodels/directory.txt
277 createDirectory("'.dirPath$'/log")
278 .dirPath$ > '.dirPath$'/log/directory.txt
279 createDirectory("'.dirPath$'/TTS")
280 .dirPath$ > '.dirPath$'/TTS/directory.txt
284 # Retrieve and store setting between sessions
286 procedure read_preferences .preferencesFile$
287 if not fileReadable(.preferencesFile$)
288 .preferencesFile$ = preferencesAppFile$
290 if fileReadable(.preferencesFile$)
291 Read from file... 'preferencesAppFile$'
292 .preferenceTable$ = selected$("Table")
293 .numPrefKeys = Get number of rows
294 for .row to .numPrefKeys
295 .variableName$ = Get value... '.row' Key
296 if variableExists(.variableName$)
297 .variableValue = Get value... '.row' Value
298 if .variableValue <> undefined
299 '.variableName$' = '.variableValue'
301 elsif variableExists(.variableName$+"$")
302 .variableValue$ = Get value... '.row' Value
303 .variableName$ = .variableName$+"$"
304 '.variableName$' = "'.variableValue$'"
308 select Table '.preferenceTable$'
313 procedure write_preferences .preferencesFile$
314 Create Table with column names... Preferences 0 Key Value
315 if index_regex(.preferencesFile$, "[a-zA-Z0-9]") <= 0
316 .preferencesFile$ = preferencesAppFile$
320 for .tableNum from 1 to 2
326 .varPrefix$ = replace_regex$(.table$, "^(.)", "\l\1", 0)
328 select Table '.table$'
329 .numTableRows = Get number of rows
330 for .tablerow to .numTableRows
331 select Table '.table$'
332 .label$ = Get value... '.tablerow' Label
333 .variableName$ = .varPrefix$+"."+(replace_regex$(.label$, "^(.)", "\l\1", 0))
334 .keyName$ = .variableName$
336 if sgc.nonPreferences$ <> "" and index(sgc.nonPreferences$, " '.variableName$' ")
338 elsif variableExists(.variableName$)
339 .value = '.variableName$'
341 elsif variableExists(.variableName$ + "$")
342 .variableName$ = .variableName$ + "$"
343 .value$ = '.variableName$'
344 elsif index(.variableName$, "_") > 0
345 .variableName$ = left$(.variableName$, rindex(.variableName$, "_") - 1)
346 .keyName$ = .variableName$
347 select Table Preferences
348 .prefRow = Search column... Key '.keyName$'
350 if variableExists(.variableName$)
351 .value = '.variableName$'
353 elsif variableExists(.variableName$ + "$")
354 .variableName$ = .variableName$ + "$"
355 .value$ = '.variableName$'
361 select Table Preferences
364 Set string value... '.row' Key '.keyName$'
365 Set string value... '.row' Value '.value$'
370 # Some extra settings
371 select Table Preferences
374 Set string value... '.row' Key wordlistDir
375 Set string value... '.row' Value 'localWordlistDir$'
377 select Table Preferences
380 Set string value... '.row' Key wordlistName
381 Set string value... '.row' Value 'wordlistName$'
383 select Table Preferences
384 Write to table file... '.preferencesFile$'
389 ###############################################################
391 # TTS (speech synthesis). Place commands in user info
394 # speakCommandDir$ = "'preferencesAppDir$'/TTS"
395 # speakCommandFile$ = ""
397 # Make sure sgc2.synthesizer is set!
398 procedure create_default_TTS .language$ .voice$ .samplefreq .gap .pitch_adj .pitch_range .words_per_minute .use_data$ .espeak_phones$
399 sgc2.synthesizer = Create SpeechSynthesizer... '.language$' '.voice$'
400 Set speech output settings... .samplefreq .gap .pitch_adj .pitch_range .words_per_minute '.use_data$' '.espeak_phones$'
404 if sgc2.synthesizer > 0
405 select sgc2.synthesizer
407 sgc2.synthesizer = -1
409 # Note, the TTScommand must set sgc2.synthesizer!
410 if config.strict$ = "'sgc.highestLevel'"
411 'sgc2.advancedTTScommand$'
413 'sgc2.normalTTScommand$'
417 .ttscommand$ = "speak"
421 .ttscommand$ = "espeak"
425 .ttscommand$ = "C:/Program Files/eSpeak/command_line/espeak.exe"
429 # Global TTS command has precedence
430 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_command.txt")
431 speakCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_command.txt"
432 if config.synthesis$ = "_DISABLED_"
434 config.synthesis$ = "eSpeak"
438 # Local TTS command, if there is no global one
439 # Command does not exist yet, create it if eSpeak is installed
440 # Make sure to quote the path!
441 if speakCommandFile$ = ""
442 # Autodetect synthesizer command
443 # if not fileReadable("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
444 # .command_path$ = ""
446 # system_nocheck PATH=${PATH}:/opt/local/bin; bash -c -- 'which '.ttscommand$' > "'speakCommandDir$'/command_path.txt"'
447 # .command_path$ < 'speakCommandDir$'/command_path.txt
449 # system_nocheck PATH=${PATH};bash -c -- 'which '.ttscommand$' > "'speakCommandDir$'/command_path.txt"'
450 # .command_path$ < 'speakCommandDir$'/command_path.txt
452 # if fileReadable(.ttscommand$)
453 # .command_path$ = .ttscommand$
456 # # Remove any newlines
457 # .command_path$ = replace$(.command_path$, "'newline$'", "", 0)
459 # # Command path found
460 # if sgc2.synthesizer <= 0 and .command_path$ <> "" and fileReadable(.command_path$)
461 # deleteFile("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
462 # fileappend "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
463 # ...'.quote$''.ttscommand$''.quote$' -v zh+f4 -s 100 'newline$'
464 # speakCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
467 # if fileReadable("'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt")
468 speakCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_eSpeak_command.txt"
470 deleteFile("'speakCommandDir$'/command_path.txt")
473 # Close off (other TTS maybe a later option)
474 if sgc2.synthesizer > 0 or (speakCommandFile$ <> "" and fileReadable(speakCommandFile$))
475 config.synthesis$ = "eSpeak"
479 # Alternative audio recorder
480 procedure set_up_recorder
491 # Global TTS command has precedence
492 sgc.useAlternativeRecorder = 0
493 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_record_command.txt")
494 createDirectory(sgc.scratchAudioDir$)
495 sgc.recordCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_record_command.txt"
496 sgc.useAlternativeRecorder = 1
497 elsif fileReadable("'speakCommandDir$'/TTS_'.osName$'_record_command.txt")
498 createDirectory(sgc.scratchAudioDir$)
499 sgc.recordCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_record_command.txt"
500 sgc.useAlternativeRecorder = 1
504 # Alternative audio player
505 procedure set_up_player
516 # Global TTS command has precedence
517 sgc.useAlternativePlayer = 0
518 if fileReadable("'globalTTSdir$'/TTS_'.osName$'_play_command.txt")
519 createDirectory(sgc.scratchAudioDir$)
520 sgc.playCommandFile$ = "'globalTTSdir$'/TTS_'.osName$'_play_command.txt"
521 sgc.useAlternativePlayer = 1
522 elsif fileReadable("'speakCommandDir$'/TTS_'.osName$'_play_command.txt")
523 createDirectory(sgc.scratchAudioDir$)
524 sgc.playCommandFile$ = "'speakCommandDir$'/TTS_'.osName$'_play_command.txt"
525 sgc.useAlternativePlayer = 1
529 ###############################################################
534 # initialiseSGC2.toneevaluation_table$ = ""
535 procedure initialize_toneevaluation_tables
537 if initialiseSGC2.toneevaluation_table$ != ""
538 select sgc2.performanceTable
541 initialiseSGC2.toneevaluation_table$ = ""
542 # Get the name of the table
543 call get_evaluation_table_labels 'config.language$'
544 performanceTableName$ = eval.performance$
546 if sgc.savePerf$ <> "" and fileReadable(sgc.savePerf$)
547 sgc2.performanceTable = Read Table from tab-separated file: sgc.savePerf$
548 Rename: performanceTableName$
549 # Check to make sure all columns are initialized, but only if Pinyin exists!
550 select sgc2.performanceTable
551 .column = Get column index: eval.pinyin$
553 select sgc2.performanceTable
555 sgc2.performanceTable = Create Table with column names... "'performanceTableName$'" 0 'eval.pinyin$' 'eval.correct$' 'eval.wrong$' 'eval.total$' 'eval.high$' 'eval.low$' 'eval.wide$' 'eval.narrow$' 'eval.unknown$' 'eval.commented$' 'eval.level$' 'eval.time$'
557 .columnNameList$ = "'eval.correct$' 'eval.wrong$' 'eval.total$' 'eval.high$' 'eval.low$' 'eval.wide$' 'eval.narrow$' 'eval.unknown$' 'eval.commented$' 'eval.level$' 'eval.time$'"
558 while index_regex(.columnNameList$, "\S")
559 .columnNameList$ = replace_regex$(.columnNameList$, "^\s+", "", 1)
560 .columnHeader$ = extractWord$(.columnNameList$, "")
561 .columnNameList$ = replace_regex$(.columnNameList$, "^\s*'.columnHeader$'\s*", "", 1)
563 select sgc2.performanceTable
564 .column = Get column index: .columnHeader$
566 select sgc2.performanceTable
567 Append column: .columnHeader$
573 sgc2.performanceTable = Create Table with column names... "'performanceTableName$'" 0 'eval.pinyin$' 'eval.correct$' 'eval.wrong$' 'eval.total$' 'eval.high$' 'eval.low$' 'eval.wide$' 'eval.narrow$' 'eval.unknown$' 'eval.commented$' 'eval.level$' 'eval.time$'
575 initialiseSGC2.toneevaluation_table$ = performanceTableName$
576 call get_toneevaluation_row 'eval.total$'
579 procedure get_toneevaluation_row .pinyin$
580 select sgc2.performanceTable
581 .row = Search column... "'eval.pinyin$'" '.pinyin$'
584 .row = Get number of rows
585 Set string value... '.row' "'eval.pinyin$'" '.pinyin$'
586 Set numeric value... '.row' 'eval.correct$' 0
587 Set numeric value... '.row' 'eval.wrong$' 0
588 Set numeric value... '.row' 'eval.total$' 0
589 Set numeric value... '.row' 'eval.high$' 0
590 Set numeric value... '.row' 'eval.low$' 0
591 Set numeric value... '.row' 'eval.wide$' 0
592 Set numeric value... '.row' 'eval.narrow$' 0
593 Set numeric value... '.row' 'eval.unknown$' 0
594 Set numeric value... '.row' 'eval.commented$' 0
595 Set numeric value... '.row' 'eval.level$' 0
596 Set numeric value... '.row' 'eval.time$' 0
597 Sort rows... 'eval.pinyin$'
598 .row = Search column... "'eval.pinyin$'" '.pinyin$'
602 procedure increment_toneevaluation_in_row .row .column$
603 select sgc2.performanceTable
604 .tmp = Get value... '.row' '.column$'
609 Set numeric value... '.row' '.column$' '.tmp'
612 Set string value: .row, eval.level$, config.strict$
616 Set string value: .row, eval.time$, .dateTime$
620 # Update existing performance file with toneevaluation
621 procedure update_toneevaluation_file
622 if sgc.savePerf$ <> "" and fileReadable(sgc.savePerf$) and initialiseSGC2.toneevaluation_table$ <> ""
623 select sgc2.performanceTable
624 Write to table file... 'sgc.savePerf$'
628 procedure increment_toneevaluation_value .pinyin$ .column$
629 call get_toneevaluation_row '.pinyin$'
630 .row = get_toneevaluation_row.row
631 call increment_toneevaluation_in_row '.row' '.column$'
633 call get_toneevaluation_row 'eval.total$'
634 .row = get_toneevaluation_row.row
635 call increment_toneevaluation_in_row '.row' '.column$'
638 procedure add_feedback_to_toneevaluation .table$
639 select Table '.table$'
640 .line1$ = Get value... 1 Text
641 .line2$ = Get value... 2 Text
642 .label$ = Get value... 3 Text
644 .label$ = "'eval.unknown$'"
647 .tones$ = replace_regex$(left$(.line1$, rindex(.line1$, ":")), "[^0-9]", "", 0)
648 .recognized$ = replace_regex$(right$(.line1$, length(.line1$)-rindex(.line1$, ":")), "[^0-9]", "", 0)
651 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.total$'
652 if .tones$ = .recognized$
653 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.correct$'
656 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.wrong$'
659 if index_regex(.label$, "(Correct|Wrong)") <= 0
660 if .label$ = "Correct"
661 .label$ = eval.correct$
663 .label$ = eval.wrong$
665 call increment_toneevaluation_value 'sgc.pinyin$' '.label$'
666 call increment_toneevaluation_value 'sgc.pinyin$' 'eval.commented$'
670 # Update performance table when SaveAudio is on
672 call update_toneevaluation_file
676 procedure setGrade .grade$
677 select Table 'wordlist$'
678 if recordedSound$ <> "" and sgc.pinyin$ <> ""
679 call get_toneevaluation_row 'sgc.pinyin$'
680 .row = get_toneevaluation_row.row
681 select sgc2.performanceTable
682 .col = Get column index... Grade
684 Insert column... 2 Grade
687 Set numeric value: .row, "Grade", '.grade$'
688 .numRows = Get number of rows
691 for .r from 2 to .numRows
692 .tmp = Get value: .r, "Grade"
700 .meanGrade = .sumGrade / .sumN
702 Set numeric value: 1, "Grade", .meanGrade
704 # Store current performance table
705 call update_toneevaluation_file
709 # Set mainPage.saveAudio$ to Grade
710 procedure set_grade_display .pinyin$
711 mainPage.saveAudio$ = ""
712 select sgc2.performanceTable
714 .col = Get column index: "Grade"
715 if .pinyin$ <> "" and .col > 0
716 call get_toneevaluation_row '.pinyin$'
717 .row = get_toneevaluation_row.row
719 .grade$ = Get value: .row, "Grade"
720 if index_regex(.grade$, "[0-9]") <= 0
726 mainPage.saveAudio$ = .grade$
730 ###############################################################
732 # Miscelaneous procedures
734 ###############################################################
737 procedure synthesize_sound .pinyin$
739 if speakCommandFile$ <> "" and fileReadable(speakCommandFile$)
740 .command$ < 'speakCommandFile$'
741 .command$ = replace$(.command$, "'newline$'", " ", 0)
743 system_nocheck PATH=${PATH}:/usr/local/bin:/opt/local/bin; bash -rc -- ''.command$' "'.pinyin$'"'
745 system_nocheck bash -rc -- ''.command$' "'.pinyin$'"'
747 system_nocheck call '.command$' "'.pinyin$'"'
749 elsif sgc2.synthesizer > 0
750 select sgc2.synthesizer
751 Play text... '.pinyin$'
755 procedure align_recordedSound .pinyin$
756 if 0 and sgc2.synthesizer > 0 and recordedSound$ <> ""
757 select Sound 'recordedSound$'
758 .recordedTextGrid = To TextGrid... pinyin
759 Set interval text... 1 1 '.pinyin$'
760 select sgc2.synthesizer
761 plus Sound 'recordedSound$'
762 plus .recordedTextGrid
763 sgc.alignedTextGrid = nowarn noprogress To TextGrid (align,trim)... 1 1 1 -35 0.1 0.1 0.08
764 Rename... AlignedTextGrid
765 select .recordedTextGrid