how i can fix this error in soundsc function

8 Ansichten (letzte 30 Tage)
n
n am 22 Dez. 2013
Bearbeitet: Walter Roberson am 3 Nov. 2019
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

Akzeptierte Antwort

John D'Errico
John D'Errico am 22 Dez. 2013
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?

Weitere Antworten (9)

Walter Roberson
Walter Roberson am 22 Dez. 2013
soundsc(double(YourData))

n
n am 22 Dez. 2013
still the same problem :(

n
n am 22 Dez. 2013
the audio data is already double but i don't know what reason of error :(

n
n am 22 Dez. 2013
please any one answer me :(

n
n am 22 Dez. 2013
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 am 23 Dez. 2013
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 Kommentar
Walter Roberson
Walter Roberson am 24 Dez. 2013
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.

Melden Sie sich an, um zu kommentieren.


n
n am 23 Dez. 2013
Bearbeitet: Walter Roberson am 3 Nov. 2019
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 Kommentar
Image Analyst
Image Analyst am 23 Dez. 2013
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.

Melden Sie sich an, um zu kommentieren.


n
n am 23 Dez. 2013
no it is not answer , sorry this the code that has error

n
n am 24 Dez. 2013
please any one help me?? i am novice in matlab :(
  2 Kommentare
Image Analyst
Image Analyst am 24 Dez. 2013
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 am 24 Dez. 2013
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 ? :(

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by