The safest option would be to load them individually and use a mask for each then save. For example:
[x1,fs] = audioread('fileName1.wav');
tinit = 1*60 + 34; % In seconds
tend = 2*60 + 4;
ll = floor(tinit*fs) : floor(tend*fs);
x1 = x1(ll); % apply the mask to the segment of audio you want
audiowrite('fileName1edit.wav',x1,fs,'BitsPerSample',24)
However, if you have a big number of files to deal with, a less reliable but more comfortable solution could be to dump all the wav files in a structure
Files = dir('*.wav');
and load them calling
[x,fs] = audioread(Files(idx).name);
within a for loop of length(Files)
inside which you could prompt a box dialog asking for the minute and second to begin and minute and second to end. For example:
for idx = 1 : length(Files)
[x,fs] = audioread(Files(idx).name);
prompt = {'Min start:','Second start:','Min end:','Second end:'};
T = inputdlg(prompt,'Enter the times',[1,20]);
Ninit = round(fs*(str2num(T{1})*60 + str2num(T{2})));
Nend = round(fs*(str2num(T{3})*60 + str2num(T{4})));
ll = Ninit:Nend;
x = x(ll); % or x = x(Ninit:Nend);
audiowrite(Files(idx).name,...);
end
See the documentation for inputdlg()
for further examples. If you are not editing the string for the output audio file in audiowrite()
with an _edit.mat
or similar, make a backup of your files in a folder, for safety.