how to read multiple .wav file from other .m file

1 view (last 30 days)
B = importdata('allfeaturesongs.m');
for i=1:5
[y, fs]=wavread(B(i)); t1=[1/fs:1/fs:length(y)/fs]; fprintf('Duration orignl = %g seconds\n', length(y)/fs); nsamples = 20 * fs; [y2, fs] = wavread(B(i), nsamples); %sound(y2, fs); t2=[1/fs:1/fs:length(y2)/fs]; fprintf('Duration splited = %g seconds\n', length(y2)/fs); figure,ax(1)=subplot(3,1,1);plot(t1,y);title('orgnl');title(B(i));xlabel('Time (sec)'); ax(2)=subplot(3,1,2);plot(t2,y2);title('splited');title('splited');xlabel('Time (sec)');
end
here is code but is gives me error like this
Warning: WAVREAD will be removed in a future release. Use AUDIOREAD instead. > In wavread at 62 In trywaystore at 6 Error using fileparts (line 33) Input must be a row vector of characters.
Error in wavread>open_wav (line 194) [pat,nam,ext] = fileparts(file);
Error in wavread (line 68) [fid,msg] = open_wav(file);
Error in trywaystore (line 6) [y, fs]=wavread(B(i));
how to solve this problem??? please give me solution thanx in advance

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!