clc
clear all
close all
H = dsp.AudioRecorder;
recorderData = zeros(1024,1);
for iloop1 = 1:100
recorderData(:,iloop1) = mean(step(H),2);
end
plot(reshape(recorderData,1,[]));
audiowrite('recorderFile.wav',reshape(recorderData,1,[]),44100);
2018/2019 版本的matlab好像會移除dsp.AudioRecorder指令,換成audioDeviceReader效果應該是一樣的。