当前位置:网站首页>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
不管你在录音的时候说了多少句话,哪怕你一句话没说,生成的文件大小都是这么大。
边栏推荐
- 【疾病检测】基于BP神经网络实现肺癌检测系统含GUI界面
- 学习笔记25--多传感器前融合技术
- uTools
- Leetcode, 3 repeatless longest subsequence
- 游戏思考15:全区全服和分区分服的思考
- Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
- I Brief introduction of radio energy transmission technology
- GL Studio 5 installation and experience
- Unity AssetBundle subcontracting
- [IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games
猜你喜欢

MPLS experiment operation

学习笔记2--高精度地图定义及价值

ES6 new method of string

Single chip microcomputer -- hlk-w801 transplant NES simulator (III)

Using tabbar in wechat applet

The technology boss is ready, and the topic of position C is up to you

Leetcode, 3 repeatless longest subsequence

Hcip day 14 (MPLS protocol)

The first "mobile cloud Cup" empty publicity meeting, looking forward to working with developers to create a new world of computing!
![[disease detection] realize lung cancer detection system based on BP neural network, including GUI interface](/img/c9/3fe8693629a8452dcfdb4349ddee0d.png)
[disease detection] realize lung cancer detection system based on BP neural network, including GUI interface
随机推荐
遊戲思考15:全區全服和分區分服的思考
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
教你白嫖Amazon rds一年并搭建MySQL云数据库(只需10分钟,真香)
Infiltration records of CFS shooting range in the fourth phase of the western regions' Dadu Mansion
游戏思考15:全区全服和分区分服的思考
10 minutes to get started quickly composition API (setup syntax sugar writing method)
Just using the way and method of consuming the Internet to land and practice the industrial Internet will not bring long-term development
Tencent cloud techo youth dream campus trip into Wuhan University
What are the affordable Bluetooth headsets? Student party parity Bluetooth headset recommendation
[Chongqing Guangdong education] Tianshui Normal University universe exploration reference
Convolutional neural network (including code and corresponding diagram)
Learning notes 25 - multi sensor front fusion technology
It's already 30. Can you learn programming from scratch?
Minimize the error
uTools
The technology boss is ready, and the topic of position C is up to you
6-2漏洞利用-ftp不可避免的问题
Circular statements in shell programming
Unity AssetBundle subcontracting
Self drawing of menu items and CListBox items