error using wavread

조회 수: 3 (최근 30일)
Bushra
Bushra 2011년 12월 31일
Hi everyone I am trying to read .wav files in a loop. names of wav files are written in .txt file. The problem is that when i run my code it sometimes works fine but sometimes it give error
??? Error using ==> wavread at 67 Cannot open file.
Error in ==> Main at 9 [y,fs1] = wavread(name);
I have tried everything but cant figure out the problem. I have checked all wav files manually by using same function i.e. wavread on command window, it runs fine there. but same time it dont ru in my code. remember, it generates the error after reading quite a few files. here's my code:
Mul13=[];
fs=16000;
input_code = textread('WordsN.txt','%s','whitespace',' \t\n\r');
len = length(input_code);
for lenth=1:len
name = char(input_code(lenth));
[y,fs1] = wavread(name);
c = melcepst(y,fs);
[c,g,j,gg] = kmeans(c,10);
c=c(:);
Mul13 = [Mul13 c];
end
can anyone help me??? need it urgently :(

답변 (1개)

Walter Roberson
Walter Roberson 2011년 12월 31일
There has been evidence that some of the MATLAB file-handling routines do not always close their files, and so when you read enough files you can run out of available file slots.
Some people have suggested that executing fclose('all') from time to time might help. This is not certain.

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by