matlab录制10s的语音
时间: 2023-12-26 22:06:20 浏览: 86
以下是使用MATLAB录制10秒语音的示例代码:
```matlab
fs = 16000; % 采样率为16000Hz
duration = 10; % 录制10秒的数据
recObj = audiorecorder(fs, 16, 1); % 创建声卡对象
recordblocking(recObj, duration); % 录制音频数据
y = getaudiodata(recObj); % 获取录音数据
filename = 'test.wav'; % 准备写入的音频数据文件
audiowrite(filename, y, fs); % 将录音数据以指定采样率写入文件
info = audioinfo(filename); % 使用audioinfo函数查看文件的信息
```
阅读全文
相关推荐
















