############################################################ # File duplicator for gating experiments # Written by Kyuchul Yoon (kyoon@ling.osu.edu) # The script reads in all the .wav files from the subdirectory one by one # and duplicates the sound file two times with a silence of 1 sec in between. ############################################################ # Get the user input form Select files and parameters word fileToProcess_(only_extensions) wav word subFolderToProcess STIMULI natural sampleRate_(in_Hz) 22050 word outFolder DUP-STIMULI endform # natural intervalBtwSounds_(in_Seconds) 0.5 # Randomize all the wav files Create Strings as file list... fileList 'subFolderToProcess$'\*.'fileToProcess$' numFiles = Get number of strings pause 'numFiles' files identified. Continue? # Process each file for i to numFiles select Strings fileList strFileName$ = Get string... i Read from file... 'subFolderToProcess$'\'strFileName$' Rename... orig # Create silence to be inserted btw/ sounds Create Sound... silence 0 0.5 sampleRate 0 Rename... silence plus Sound orig Concatenate Rename... dup1 Copy... dup2 Copy... dup3 plus Sound dup2 plus Sound dup1 Concatenate Rename... dupped system mkdir 'outFolder$' select Sound dupped Write to WAV file... 'outFolder$'\'strFileName$' select Sound orig plus Sound silence plus Sound dup1 plus Sound dup2 plus Sound dup3 plus Sound dupped Remove endfor ############ END OF SCRIPT ###############