当前位置:网站首页>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
不管你在录音的时候说了多少句话,哪怕你一句话没说,生成的文件大小都是这么大。
边栏推荐
- CTF daily question day45 sensor
- No converter found for return value of type: class
- 首场“移动云杯”空宣会,期待与开发者一起共创算网新世界!
- Liteos learning - first knowledge of development environment
- k线图形态这样记(口诀篇)
- 8.8.4-PointersOnC-20220215
- How to compress video size while adding watermark with one click?
- [IVX junior engineer training course 10 papers] 06 database and services
- 笔者更加愿意将产业互联网看成是一个比消费互联网要丰富得多的概念
- 卷積神經網絡(包含代碼與相應圖解)
猜你喜欢

Develop a simple login logic based on SSM

Learning notes 25 - multi sensor front fusion technology

Game thinking 15: thinking about the whole region and sub region Services
![[IVX junior engineer training course 10 papers to get certificates] 09 chat room production](/img/a8/25215e74162b7ab3f29df65681932b.jpg)
[IVX junior engineer training course 10 papers to get certificates] 09 chat room production
![[rust web rokcet Series 1] Hello, world and get, post, put, delete](/img/d8/7dd5fe409d349a13128b6af554f952.jpg)
[rust web rokcet Series 1] Hello, world and get, post, put, delete

Leetcode, 3 repeatless longest subsequence

学习笔记2--高精度地图定义及价值
![[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
![[IVX junior engineer training course 10 papers] 05 canvas and aircraft war game production](/img/dc/e9adb1b41c2175c6f18d8027e0530a.jpg)
[IVX junior engineer training course 10 papers] 05 canvas and aircraft war game production

SAP ui5 beginner tutorial 20 - explanation of expression binding usage of SAP ui5
随机推荐
Basic concepts of machine learning
ACM tutorial - quick sort (regular + tail recursion + random benchmark)
Android high frequency network interview topic must know and be able to compare Android development environment
Docker installing Oracle_ 11g
Brief introduction to the development of mobile network
error: . repo/manifests/: contains uncommitted changes
Global and Chinese markets of edge AI software 2022-2028: Research Report on technology, participants, trends, market size and share
Réseau neuronal convolutif (y compris le Code et l'illustration correspondante)
Unity AssetBundle subcontracting
学习笔记24--多传感器后融合技术
Recommend an online interface mock tool usemock
卷积神经网络(包含代码与相应图解)
Global and Chinese markets of beverage seasoning systems 2022-2028: Research Report on technology, participants, trends, market size and share
6-2 vulnerability exploitation - inevitable problems of FTP
Android: the kotlin language uses grendao3, a cross platform app development framework
首场“移动云杯”空宣会,期待与开发者一起共创算网新世界!
学习笔记3--高精度地图关键技术(上)
Study note 2 -- definition and value of high-precision map
II Basic structure of radio energy transmission system
Principle of finding combinatorial number and template code