can anybody help me with this code error ?

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

Adam
Adam 2015년 11월 25일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 25일

0 개 추천

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.

카테고리

질문:

2015년 11월 25일

답변:

2015년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by