# Makes pairs of identical sounds with pause in between for all sound files in a folder # The ISI duration, save directory, and prefix for sound files # can be specified in the input menu # Author: Danielle Daidone 4/26/17 # # Modified from original script that made pairs of two sounds # using all the sound files in a folder. # It did not make a pair of two identical sounds. # Author: Shigeto Kawahara # Version: Dec 28th 2014 form Make pairs of identical sounds with pause comment Specify the folder where the sound files are located sentence inputDir C:\Users\Danielle\Desktop\ comment Specify the folder where concatenated files will be saved comment Folder "concatenated" will be created within this directory sentence saveDir C:\Users\Danielle\Desktop\ comment Specify the pause duration in seconds positive silenceDur 0.5 comment Specify the prefix for concatenated files (optional) sentence filePrefix endform # remove any objects open in object window select all numberOfSelectedObjects = numberOfSelected () if numberOfSelectedObjects > 0 Remove endif createDirectory: "'saveDir$'\concatenated" Create Strings as file list... list 'inputDir$'*.wav numberOfFiles = Get number of strings for i to numberOfFiles # open the first file select Strings list fileName1$ = Get string... i Read from file... 'inputDir$''fileName1$' soundOne$=selected$("Sound") # create silence silence$ = Create Sound from formula... silence Mono 0 silenceDur 44100 0 silenceSound$=selected$("Sound") # create copy of first sound file select Sound 'soundOne$' soundTwo$ = Copy: soundOne$ # now concatenate sound files with pause in between select all minus Strings list Concatenate # save new concatenated sound file with optional prefix name$ = fileName1$ - ".wav" Write to WAV file... 'saveDir$'\concatenated\'filePrefix$''fileName1$' select all minus Strings list Remove endfor select all Remove appendInfoLine: "Files successfully created!"