#Sound File Concatenation Script #this script read sound files whose names and path are designated in an excel file #user needs to save the excel file in tab-deliminated txt file #the script then read these sound files and concatenate them into one sound file and save it #by Shuo Zhang form Get Input Directory comment Please enter the directory path where the subject, verb, object folders and the excel file are located text input_directory ~/Desktop/PraatScript/ comment Please enter the file name of the excel file text fileName table2.txt comment Please enter the directory path where the concatenated sentences will be saved text output_directory ~/Desktop/PraatScript/Result/ comment Please enter the number of sentences you would like to derive integer nos 5 endform table=do ("Read Table from tab-separated file...", input_directory$ + fileName$) select table table$=selected$ ("Table") for i from 1 to nos subjectFile$=Table_'table$'$ [i, 3] objectFile$=Table_'table$'$ [i, 5] verbFile$=Table_'table$'$ [i, 7] sentenceName$=Table_'table$'$ [i,9] pause1=do ("Read from file...", input_directory$ + "pause/100.wav") soundSubject=do ("Read from file...", input_directory$ + subjectFile$) pause2=do ("Read from file...", input_directory$ + "pause/350.wav") soundObject=do ("Read from file...", input_directory$ + objectFile$) pause3=do ("Read from file...", input_directory$ + "pause/75.wav") soundVerb=do ("Read from file...", input_directory$ + verbFile$) pause4=do ("Read from file...", input_directory$ + "pause/100.wav") select pause1 plus soundSubject plus pause2 plus soundVerb plus pause3 plus soundObject plus pause4 soundSentence = Concatenate select soundSentence do("Save as WAV file...", output_directory$ + sentenceName$) select pause1 plus soundSubject plus pause2 plus soundVerb plus pause3 plus soundObject plus pause4 plus soundSentence Remove endfor select table Remove