在Linux Matlab中利用声卡采集声音,需要用到audiorecorder函数(在windows中是wavrecord),
r = audiorecorder(44100, 16, 1); %采样率,采样位数,单声道
record(r); % speak into microphone…调用record方法的时候开始录音
pause(r);
p = play(r); % listen
resume(r); % speak again
stop(r);
p = play(r); % listen to complete recording
mySpeech = getaudiodata(r, ‘int16’); % get data as int16 array