i am trying a code on speech recognition
2 views (last 30 days)
Show older comments
clc;
close all;
clear all;
figure(2)
fs=44100;
[y, fs]=audioread('oil.wav'); % Read wave file
%sound(y, fs); % Playback
left=y(:,1); % Left channel
right=y(:,2); % Right channel
subplot(3,1,1),
h=((1:length(left))/fs);
plot(h,left)
subplot(3,1,2),
h1=((1:length(right))/fs);
plot(h1,right)
h3=[h h1];
subplot(3,1,3)
plot(h3)
figure(3)
recObj = audiorecorder
disp('Start speaking.')
recordblocking(recObj, 3);
disp('End of Recording.');
y10 = getaudiodata(recObj);
left1=y10(:,1); % Left channel
right1=y10(:,2); % Right channel
subplot(4,1,1),
h2=((1:length(left1))/fs);
plot(h2,left1)
subplot(4,1,2),
h4=((1:length(right1))/fs);
plot(h4,right1)
h5=[h2 h4];
subplot(4,1,3)
plot(h5)
sound(y10)
figure(4)
z=xcorr(h3,h5)
plot(z)
if (h5<=z)
disp('oil')
else
disp('wrong')
end
i am trying to recognize a word oil and the error is Index exceeds matrix dimensions.
kindly help me if any already have real time speech recognition code thanx in advance.
0 Comments
Answers (0)
See Also
Categories
Find more on Speech Recognition in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!