error using wavread

1 visualización (últimos 30 días)
Bushra
Bushra el 31 de Dic. de 2011
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 :(

Respuestas (1)

Walter Roberson
Walter Roberson el 31 de Dic. de 2011
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.

Categorías

Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by