20-4 ��������������?

ڭ̦bĤ@`wgFpŪTɮסAæbĤG`p󼽩񭵰TCMATLAB ]䴩ѳJŪTA]iHinsAҨϥΪOO audiorecord M recordblockingAШUC򥻽dҡG

Example 1: 20-TŪgBsP/audioRecord01.mduration=3; % ɶ recObj=audiorecorder; fprintf('N}l %g G', duration); pause fprintf('...'); recordblocking(recObj, duration); fprintf('\n'); fprintf('N}lG'); pause play(recObj);N}l 3 G... N}lG

bWzdҤAڭ̥ϥ audiorecorder ӲͿ recObjAMAϥ recordblocking OӶiTC]ЪWzdҫA~ݱoX骺y{C^

ѩbWҤAڭ̦bϥ audiorecorder ɡAåwѼơAҥH{|HUCw]ѼƨӶiGWv 8000 HzAIѪR׬ 8 bitsAnDC

YnϥΤPѼƨӶiAڭ̥iHNoǰѼưe audiorecorder OAdҦpUG

Example 2: 20-TŪgBsP/audioRecord02.mfs=16000; % Wv nBits=16; % IѪRסAO 8 16 24 nChannel=1; % nDӼơAO 1]nD^ 2]nDΥ魵^ duration=3; % ɶ]^ recObj=audiorecorder(fs, nBits, nChannel); fprintf('N}l %g G', duration); pause fprintf('...'); recordblocking(recObj, duration); fprintf('\n'); fprintf('N}lG'); pause play(recObj); y = getaudiodata(recObj, 'double'); % get data as a double array plot((1:length(y))/fs, y); xlabel('Time (sec)'); ylabel('Amplitude');N}l 3 G... N}lG

bWҤAӭIG


MATLAB{]pGJg