matlab 使用 audiorecorder、recordblocking录制声音,play 播放声音,audiowrite 保存声音 | 您所在的位置:网站首页 › 使用录音机程序录制声音并保存怎么设置 › matlab 使用 audiorecorder、recordblocking录制声音,play 播放声音,audiowrite 保存声音 |
因为我现在使用的 matlab 是 2018a,所以不能使用废弃了的 wavreord 和 wavplay,只能使用 audiorecorder。 Fs=44800;%麦克分采样率 nBits=16;%量化位数 nChannel=1;%录音的通道数,可以设置1或者2 time=5;%录制音频的时间,单位是秒 recObj = audiorecorder(Fs, nBits, nChannel); disp('Start speaking.') %开始录制声音 recordblocking(recObj, time); disp('End of Recording.'); % 回放录音数据 play(recObj); % 获取录音数据 myRecording = getaudiodata(recObj); % 绘制录音数据波形 plot(myRecording); %存储语音信号 filename = 'audiorecorder_data_1.wav'; audiowrite(filename, myRecording, Fs);
|
CopyRight 2018-2019 实验室设备网 版权所有 |