error using wavread
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
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 :(
0 Commenti
Risposte (1)
  Walter Roberson
      
      
 il 31 Dic 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.
0 Commenti
Vedere anche
Categorie
				Scopri di più su Audio I/O and Waveform Generation in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

