How to process and rewrite multiple wav file into different folder?
19 views (last 30 days)
Epri Pratiwi on 11 Aug 2020
I have a folder with multiple song. After I processed these .wav, I also want to rewrite and put it into different folder. How to do this?
However, this .wav has been already processed from multiple function (wavToPreprocWav.m, wavToElectrode, and electrodeToWav)
[y, fs] = audioReadNCU();
[y, fs] = wavToPreprocWav(y, fs);
band = wavToElectrode(y, fs);
y = electrodeToWav(band, fs);
Kiran Felix Robert on 14 Aug 2020
It is my understanding that you are trying to read multiple files one by one,process it and save the processed file to a different location. This can be done as shown in the following example (assuming all the files in the read folder are audio files). Refer to the dir documentation for more details.
FileList = dir('*.*');
for i = 1:length(FileList)
file = FileList(i).name;
% perform all necesary functions
% [y,fs] = audioread(file);
% [y, fs] = wavToPreprocWav(y, fs);
%band = wavToElectrode(y, fs);
%y = electrodeToWav(band, fs);
write_filename = "new_" +num2str(i)+".wav";
%write_directory is the path to the directoy where
%the processed file needs to be saved
Hope this Helps.
Kiran Felix Robert