当前位置:网站首页>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
不管你在录音的时候说了多少句话,哪怕你一句话没说,生成的文件大小都是这么大。
边栏推荐
- Circular statements in shell programming
- Infiltration records of CFS shooting range in the fourth phase of the western regions' Dadu Mansion
- Memorabilia of domestic database in June 2022
- 6-2漏洞利用-ftp不可避免的问题
- Basic usage of shell script
- Global and Chinese market of avionics systems 2022-2028: Research Report on technology, participants, trends, market size and share
- [disease detection] realize lung cancer detection system based on BP neural network, including GUI interface
- [IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games
- Leetcode 45 Jumping game II (2022.02.14)
- Unity AssetBundle subcontracting
猜你喜欢

LeetCode、3无重复最长子序列

Edge computing accelerates live video scenes: clearer, smoother, and more real-time

The pain of Xiao Sha
![[image enhancement] vascular image enhancement based on frangi filter with matlab code](/img/b3/b4164fb7db8645f470180e352b5717.png)
[image enhancement] vascular image enhancement based on frangi filter with matlab code

遊戲思考15:全區全服和分區分服的思考

SAP ui5 beginner tutorial 20 - explanation of expression binding usage of SAP ui5

SQL injection for Web Security (2)

Memorabilia of domestic database in June 2022
![Private project practice sharing [Yugong series] February 2022 U3D full stack class 009 unity object creation](/img/eb/b1382428d6578b8561d7fcc1a2a5cd.jpg)
Private project practice sharing [Yugong series] February 2022 U3D full stack class 009 unity object creation
![[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me](/img/b8/31a498c89cf96567640677e859df4e.jpg)
[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me
随机推荐
MySQL winter vacation self-study 2022 12 (4)
Basic number theory -- Gauss elimination
ES6 new method of string
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
Mathematics - feelings -20220215
I'll teach you to visit Amazon RDS for a year and build a MySQL cloud database (only 10 minutes, really fragrant)
CTF daily question day45 sensor
教你白嫖Amazon rds一年并搭建MySQL云数据库(只需10分钟,真香)
CEPH buffer yyds dry inventory
Fastadmin controls the length of fields in the table
Load and domcontentloaded in JS
SAP ui5 beginner tutorial XXI - trial version of custom formatter of SAP ui5
微信小程序中使用tabBar
技术大佬准备就绪,话题C位由你决定
MySQL application day02
Android: the kotlin language uses grendao3, a cross platform app development framework
Just using the way and method of consuming the Internet to land and practice the industrial Internet will not bring long-term development
Data visualization in medical and healthcare applications
How can I batch produce the same title for the video?
Day 13 of hcip (relevant contents of BGP agreement)