フィルターのクリア

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 Center および File ExchangeSpeech Recognition についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by