matlab 实时录音

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效果应该是一样的。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章