当前位置:网站首页>matlab 使用 audiorecorder、recordblocking录制声音,play 播放声音,audiowrite 保存声音
matlab 使用 audiorecorder、recordblocking录制声音,play 播放声音,audiowrite 保存声音
2022-07-02 01:25:00 【胡刚2016】
因为我现在使用的 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);


可以看到录制生成的文件的大小为438KB
它的计算方式是:Fs * nBits / 8 * time * nChannel / 1024
即:44800 * 16 / 8 * 5 * 1 / 1024 = 437.5KB
不管你在录音的时候说了多少句话,哪怕你一句话没说,生成的文件大小都是这么大。
边栏推荐
- MPLS experiment operation
- 8.8.4-PointersOnC-20220215
- Laravel artisan 常用命令
- [IVX junior engineer training course 10 papers to get certificates] 01 learn about IVX and complete the New Year greeting card
- uTools
- Load and domcontentloaded in JS
- Minimize the error
- 卷積神經網絡(包含代碼與相應圖解)
- MySQL winter vacation self-study 2022 12 (4)
- 教你白嫖Amazon rds一年并搭建MySQL云数据库(只需10分钟,真香)
猜你喜欢

电商系统中常见的9大坑,你踩过没?

II Basic structure of radio energy transmission system

How does schedulerx help users solve the problem of distributed task scheduling?

The pain of Xiao Sha

This is the report that leaders like! Learn dynamic visual charts, promotion and salary increase are indispensable

Learning note 24 - multi sensor post fusion technology

Recommend an online interface mock tool usemock

企业应该选择无服务器计算吗?

Réseau neuronal convolutif (y compris le Code et l'illustration correspondante)
![[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games](/img/69/44219af52baef20cedec3870147589.jpg)
[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games
随机推荐
Look at the industrial Internet from a new perspective and seek the correct ways and methods of industrial Internet
Self drawing of menu items and CListBox items
Just using the way and method of consuming the Internet to land and practice the industrial Internet will not bring long-term development
Datawhale 社区黑板报(第1期)
成功实现边缘编码需要了解的六大经验教训
How to compress video size while adding watermark with one click?
Appium inspector can directly locate the WebView page. Does anyone know the principle
This is the report that leaders like! Learn dynamic visual charts, promotion and salary increase are indispensable
Altium designer measure distance (ctrl+m)
6-3漏洞利用-SSH环境搭建
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
Introduction to ffmpeg Lib
[IVX junior engineer training course 10 papers] 06 database and services
Hcip day 14 (MPLS protocol)
It's already 30. Can you learn programming from scratch?
Brief description of grafana of # yyds dry goods inventory # Prometheus
GL Studio 5 installation and experience
969 interlaced string
The pain of Xiao Sha
How can I batch produce the same title for the video?