how i can fix this error in soundsc function

10 ビュー (過去 30 日間)
n
n 2013 年 12 月 22 日
編集済み: Walter Roberson 2019 年 11 月 3 日
hi hope you are well
i am using matlab 2013
please please how i can fix this error
Error using soundsc (line 25) Audio data must be real and floating point.
in code for speech recognition that compares two sound and returns as result a "matching" or a "not matching

採用された回答

John D'Errico
John D'Errico 2013 年 12 月 22 日
Read the error message.
"Error using soundsc (line 25) Audio data must be real and floating point."
Walter left one thing out.
soundsc(real(double(YourData)))
Even better, figure out why your data is either not real or not double.
Was this really worth waiting for 9 hours?

その他の回答 (9 件)

Walter Roberson
Walter Roberson 2013 年 12 月 22 日
soundsc(double(YourData))

n
n 2013 年 12 月 22 日
still the same problem :(

n
n 2013 年 12 月 22 日
the audio data is already double but i don't know what reason of error :(

n
n 2013 年 12 月 22 日
please any one answer me :(

n
n 2013 年 12 月 22 日
thaaaaaaaank you soooo much Mr i really appreciate your helps
ok Mr i linked this code in matlab with vb.net so when i call it in vb this message appear
so please what is the problem it can be :(

n
n 2013 年 12 月 23 日
please where are you :(
this is a code
function test2 =test2()
clear;
[x,f]=audioread('C:\Users\TOSHIBA\father.wav');
extract=melcepst(x,f);
save( 'C:\Users\TOSHIBA\father.mat','extract');
[x1,f1]=audioread('C:\Users\TOSHIBA\color.wav');
extract2=melcepst(x1,f1);
save( 'C:\Users\TOSHIBA\color.mat','extract2');
Fid=fopen('C:\Users\TOSHIBA\path1.txt'); A=fscanf(Fid,'%u'); path=fscanf(Fid,'%s'); %path=mat2str(path); fclose=Fid;
[x,fsampling]=audioread(path); pause(5); x=fft(x); fp=100; fs=1000; wp=2*fp/fsampling; ws=2*fs/fsampling; [N,wn]=buttord(wp,ws,1,5); [b,a]=butter(N,wn); y=filter(b,a,x); soundsc((real(double(y))),fsampling)
[h,t]=impz(b,a); N1=size(h,1); n=1:N1;
extract=melcepst(y,fsampling); if(A==1) B1=importdata('C:\Users\TOSHIBA\father.mat'); d1=disteusq(extract,B1); result1=int64(sum(sum(d1))); if ((result1>=1517405)&&(result1<=3399480)) test='true'; else test='false'; end end if(A==2) B2=importdata('C:\Users\TOSHIBA\color.mat'); d2=disteusq(extract,B2); result2=int64(sum(sum(d2))); if ((result2>=521370)&&(result2<=668471)) test='true'; else test='false'; end end
  1 件のコメント
Walter Roberson
Walter Roberson 2013 年 12 月 24 日
Where am I? In the middle of an extended power failure due to a large ice storm. 1/2 million people without power in below-freezing temperatures.

サインインしてコメントする。


n
n 2013 年 12 月 23 日
編集済み: Walter Roberson 2019 年 11 月 3 日
function test2 =test2()
clear;
[x,f]=audioread('C:\Users\TOSHIBA\father.wav');
extract=melcepst(x,f);
save( 'C:\Users\TOSHIBA\father.mat','extract');
[x1,f1]=audioread('C:\Users\TOSHIBA\color.wav');
extract2=melcepst(x1,f1);
save( 'C:\Users\TOSHIBA\color.mat','extract2');
Fid=fopen('C:\Users\TOSHIBA\path1.txt');
A=fscanf(Fid,'%u');
path=fscanf(Fid,'%s'); %path=mat2str(path); fclose=Fid;
[x,fsampling]=audioread(path);
pause(5);
x=fft(x);
fp=100;
fs=1000;
wp=2*fp/fsampling;
ws=2*fs/fsampling;
[N,wn]=buttord(wp,ws,1,5);
[b,a]=butter(N,wn);
y=filter(b,a,x);
soundsc((real(double(y))),fsampling)
[h,t]=impz(b,a);
N1=size(h,1);
n=1:N1;
extract=melcepst(y,fsampling);
if(A==1)
B1=importdata('C:\Users\TOSHIBA\father.mat');
d1=disteusq(extract,B1);
result1=int64(sum(sum(d1)));
if ((result1>=1517405)&&(result1<=3399480))
test='true';
else
test='false';
end
end
if(A==2)
B2=importdata('C:\Users\TOSHIBA\color.mat');
d2=disteusq(extract,B2);
result2=int64(sum(sum(d2)));
if ((result2>=521370)&&(result2<=668471))
test='true';
else
test='false';
end
end
end
  1 件のコメント
Image Analyst
Image Analyst 2013 年 12 月 23 日
Is this the answer? You posted it as an "answer" to your original question. If it's not an answer/solution, then add it as a "Comment" to someone else's answer.

サインインしてコメントする。


n
n 2013 年 12 月 23 日
no it is not answer , sorry this the code that has error

n
n 2013 年 12 月 24 日
please any one help me?? i am novice in matlab :(
  2 件のコメント
Image Analyst
Image Analyst 2013 年 12 月 24 日
Please stop adding answers and make them comments instead. These are not answers. Anyway, you marked it as accepted so a lot of people probably aren't even bothering to look at this anymore, figuring you got it solved.
n
n 2013 年 12 月 24 日
Aha , so sorry Mr. I didn't know this rule before , thanks for notify me .
my last helping request is the second error another of first one that solved , can i post it in another question or what ? :(

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by