필터 지우기
필터 지우기

Record and save audio with your specific file name for the audio.

조회 수: 5 (최근 30일)
kim
kim 2022년 12월 3일
댓글: Walter Roberson 2022년 12월 4일
I want to record and save an audio with my specific filename.wav file and then to test it when it match my voice with that file or not. please help me. this is my code.
clc
clear all
close all
warning off
Fs=8000;%Sampling frequency in hertz
ch=1;%Number of channels--2 options--1 (mono) or 2 (stereo)
datatype='uint8';
nbits=16;%8,16,or 24
Nseconds=5;
% to record audio data from an input device ...
...such as a microphone for processing in MATLAB
recorder=audiorecorder(Fs,nbits,ch);
disp('Start speaking..')
%Record audio to audiorecorder object,...
...hold control until recording completes
recordblocking(recorder,Nseconds);
disp('End of Recording.');
%Store recorded audio signal in numeric array
x=getaudiodata(recorder,datatype);
%Write audio file
audiowrite('test.wav',x,Fs);
  댓글 수: 3
kim
kim 2022년 12월 4일
편집: kim 2022년 12월 4일
yes please help me . I want to create a real time audio and name it by myself I dont want the test.wav to be a named. like when youre entering a voice activation your voice will verify it according to the audio. and then it will say access granted or denied sorry for my bad english. @Walter Roberson
kim
kim 2022년 12월 4일
Iam creating a voice recognition that will allow user to register and save his/her audio to the database and when he/she log in or speak it will detect that its from his/her and it will access granted. what should I write with that instead?

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

답변 (1개)

Walter Roberson
Walter Roberson 2022년 12월 4일
To allow the user to create the file name use uiputfile
[filename, pathname] = uiputfile('*.wav', 'File name for output');
if isnumeric(filename); return; end %user cancel
fullname = fullfile(pathname, filename);
audiowrite(fullname, x, Fs)
There are a number of posts talking about Voice Recognition; see https://www.mathworks.com/matlabcentral/answers/?term=tag%3A%22voice+recognition%22
Note: some of those posts are actually about Speech Recognition rather than Voice Recognition. Voice Recognition is when you are trying to identify who is speaking. Speech Recognition is when you are trying to identify what they are saying.
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 12월 4일
Replace
audiowrite('test.wav',x,Fs);
with
[filename, pathname] = uiputfile('*.wav', 'File name for output');
if isnumeric(filename); return; end %user cancel
fullname = fullfile(pathname, filename);
audiowrite(fullname, x, Fs)

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

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by