can anybody help me with this code error ?

5 ビュー (過去 30 日間)
mohammed
mohammed 2015 年 11 月 25 日
回答済み: Walter Roberson 2015 年 11 月 25 日
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 日
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.

カテゴリ

Help Center および File ExchangeSpeech Recognition についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by