I have a folder consisting of wav files starting from 1 to 20, For instance 1.wav , 2.wav ....., 20.wav etc. I want to concatenate it serially but it is not concatenating serially . please suggest some help
I am using this code:
form Concatenate sound files
comment Directory of input sound files
text Sound_directory C:\temp\
sentence Sound_file_extension .wav
comment Save the final file as
text Save_as C:\temp\temp.wav
endform
# Here, you make a listing of all the sound files in the specified directory.
Create Strings as file list... list 'sound_directory$'*'sound_file_extension$'
numberOfFiles = Get number of strings
for ifile to numberOfFiles
select Strings list
filename$ = Get string... ifile
# A sound file is opened from the listing:
Read from file... 'sound_directory$''filename$'
endfor
# Now, concatenate all files into a single file
select all
minus Strings list
Concatenate
# And save the resulting file
Write to WAV file... 'save_as$'
select all
Remove
I have found the solution When I am creating string list Create Strings as file list...
it creates a list in alphabetical order
so you get 1.wav, 10.wav, 11.wav, … 2.wav, 20.wav… etc and if i rename my files as 01.wav; 02.wav, the above code woks wells.