当前位置:网站首页>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
不管你在录音的时候说了多少句话,哪怕你一句话没说,生成的文件大小都是这么大。
边栏推荐
- Global and Chinese markets of beverage seasoning systems 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of picture archiving and communication system (PACS) 2022-2028: Research Report on technology, participants, trends, market size and share
- Réseau neuronal convolutif (y compris le Code et l'illustration correspondante)
- k线图形态这样记(口诀篇)
- Basic number theory -- Gauss elimination
- Basic usage of shell script
- Learning note 24 - multi sensor post fusion technology
- CEPH buffer yyds dry inventory
- Global and Chinese markets of digital crosspoint switches and mux/demux 2022-2028: Research Report on technology, participants, trends, market size and share
- Study note 2 -- definition and value of high-precision map
猜你喜欢
How does schedulerx help users solve the problem of distributed task scheduling?
Principle of finding combinatorial number and template code
6-3漏洞利用-SSH环境搭建
Datawhale 社区黑板报(第1期)
Unity AssetBundle subcontracting
What are the affordable Bluetooth headsets? Student party parity Bluetooth headset recommendation
教你白嫖Amazon rds一年并搭建MySQL云数据库(只需10分钟,真香)
SQL injection for Web Security (2)
[IVX junior engineer training course 10 papers to get certificates] 0708 news page production
现货黄金分析的技巧有什么呢?
随机推荐
Part 29 supplement (XXIX) basis of ECMAScript
关于ASP.NET CORE使用DateTime日期类型参数的一个小细节
What are the affordable Bluetooth headsets? Student party parity Bluetooth headset recommendation
GL Studio 5 安装与体验
SQL injection for Web Security (2)
Game thinking 15: thinking about the whole region and sub region Services
Penser au jeu 15: penser au service complet et au sous - service
8.8.4-PointersOnC-20220215
【疾病检测】基于BP神经网络实现肺癌检测系统含GUI界面
Global and Chinese market of collaborative applications 2022-2028: Research Report on technology, participants, trends, market size and share
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
笔者更加愿意将产业互联网看成是一个比消费互联网要丰富得多的概念
No converter found for return value of type: class
About asp Net core uses a small detail of datetime date type parameter
[Maya] the error of importing Maya into Metahuman
Modeling essays series 124 a simple coding method
[IVX junior engineer training course 10 papers] 02 numerical binding and adaptive website production
Ubuntu20.04 PostgreSQL 14 installation configuration record
Using tabbar in wechat applet
Sql--- related transactions