필터 지우기
필터 지우기

I need help I'm trying to have an issue here like I want to detect that speaker and when it recognizes the voice it will say grant This is my code. In the testing part.

조회 수: 1 (최근 30일)
clear,clc,close all
warning off;
% Parameters
Fs = 8000; % Sampling frequency
BtRt = 8;
T = 2; % Recording time
NumS = 5; % Number of samples for training
SDf = 10; % Standard deviation around frequency values
%% Recording user voice
USER = zeros(3*NumS,T*Fs); % Preallocation for recordings
% Record your voice for a second.
recObj = audiorecorder(Fs,BtRt,1);
disp('Get Ready')
pause(3)
disp('Say something on first')
recordblocking(recObj,T);
pause(1)
tmp = getaudiodata(recObj);
USER(3,:) = tmp';
pause(3)
disp('Say something on second')
recordblocking(recObj,T);
pause(1)
tmp = getaudiodata(recObj);
USER(3,:) = tmp';
pause(3)
disp('Say something on third')
recordblocking(recObj,T);
pause(1)
tmp = getaudiodata(recObj);
USER(3,:) = tmp';
% output of whether audio is granted or denied
disp(tmp)
if recObj==1
msgbox('Access Granted.')
% read file
y=audioread('Accessgranted.mp3')
% play soud file
sound(y,22050)
disp('Access Granted.')
end
if recObj==0
msgbox('Access Denied.')
% read file
y= audioread('Accessdenied.mp3')
sound(y,22050)
disp('Access Denied.')
end
  댓글 수: 14
Walter Roberson
Walter Roberson 2022년 12월 8일
In another question, the user posted code that extracts pitch, and which compares that extracted pitch to a list of (at most) 5 stored pitches to find the closest stored pitch. But that code stopped short of checking how close the analyzed pitch is, and missed out on the idea that once you had identified which of the stored pitches was closest, that you could use the index to look up the name associated with that pitch.
Jan
Jan 2022년 12월 8일
편집: Jan 2022년 12월 8일
@Walter Roberson: Thanks for mentioning the former questions of kim.
The online tutorial takes about 2 hours. It saves much more time than you waste by writing not working codes. Especially if you are a student and should implement a solution effciently, it is the best strategy to learn how to work with the selected tool.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Speech Recognition에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by