can anybody help me with this code error ?

5 visualizaciones (últimos 30 días)
mohammed
mohammed el 25 de Nov. de 2015
Respondida: Walter Roberson el 25 de Nov. de 2015
I have this code for voice recognition and when I run it I get error :
--------------
Error using wavread (line 66)
Invalid Wave File. Reason: Cannot open file.
Error in Untitled2 (line 16)
[t, fs] = wavread (file);
------------------------
This is the code I have : attached
  1 comentario
Adam
Adam el 25 de Nov. de 2015
The error seems fairly self-explanatory and suggests the code is fine, but your wav file is in the wrong format or corrupted or, for some other reason cannot be read by wavread.
wavread no longer exists in R2015b apparently so I assume you are using an earlier version of Matlab.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 25 de Nov. de 2015
Your code
file = sprintf ('%s%d.wav','rec',j);
path='rec1.wav';
file=cat(2,path,file);
is going to create the file name 'rec1.wavrec1.wav' which does not exist.
You wrote the file without using any path, so do not use a path when creating the name to read it from.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by