# This script renames all the sound files in a given folder # in a way that it adds a beginning to the filename that a user can define. # This does not erase the original sound files, but renames them and saves them # into a user defined folder under a new name. # 6.3.2007 Riikka Ullakonoja form Directory and name of new file? comment Sound file directory: text Sound_file_directory U:\Aineistot\temp\D\ sentence Sound_file_extension .wav comment Where do you want to save the renamed files? text directory U:\Aineistot\040405parts\ comment What beginning of the name do you want to give to the new files? text name D_ endform # Read lists of sound and Pitch files from the given directory: Create Strings as file list... soundfiles 'sound_file_directory$'*'sound_file_extension$' Sort numberOfSoundFiles = Get number of strings # Open any existing Sound file and save under new name select Strings soundfiles for ifile to numberOfSoundFiles soundfilename$ = Get string... ifile filename$ = left$ (soundfilename$, (length (soundfilename$) - length (sound_file_extension$))) nowarn Read from file... 'sound_file_directory$''soundfilename$' Write to WAV file... 'directory$''name$''soundfilename$' Remove select Strings soundfiles endfor Remove