################################################## ## ## Downsamples specified .wav files to 16000 ## Levels specified .wav files to 65dB ## ## Pauline Welby, welby@ling.ohio-state.edu ## July 21, 2002 ## ## Modified to add leveling - Cynthia Clopper 1/11/07 #################################################### form Input directory name without final slash word dirName C:\ comment To overwrite existing files, use same directory for output directory. word outDir C:\ comment Specify new sampling rate. positive newrate 16000 comment Specify new RMS level positive newlevel 65 endform # Warn the user against overwriting files if "'dirName$'" == "'outDir$'" pause Input and output directories are the same. Files will be OVERWRITTEN. Continue? endif # Creates a list of files to be worked on #Read Strings from raw text file... 'dirName$'\list.txt Create Strings as file list... list 'dirName$'\*.wav # loop that goes through all files numberOfFiles = Get number of strings for ifile to numberOfFiles select Strings list fileName$ = Get string... ifile baseFile$ = fileName$ - ".wav" # Read in the Sound file with that base name Read from file... 'dirName$'\'baseFile$'.wav #level select Sound 'baseFile$' Scale intensity... 'newlevel' #resample Resample... 'newrate' 50 # save file Write to WAV file... 'outDir$'\'baseFile$'.wav # object cleanup Remove select Sound 'baseFile$' Remove endfor # complete object cleanup select Strings list Remove ### END OF SCRIPT ###