linux arecord录音
首先是arecord的使用方法:(arecord -h)
-h, --help help--version print current version
-l, --list-devices list all soundcards and digital audio devices
-L, --list-pcms list device names
-D, --device=NAME select PCM by name
-q, --quiet quiet mode
-t, --file-type TYPE file type (voc, wav, raw or au)
-c, --channels=# channels
-f, --format=FORMAT sample format (case insensitive)
-r, --rate=# sample rate
-d, --duration=# interrupt after # seconds
-s, --samples=# interrupt after # samples per channel
-M, --mmap mmap stream
-N, --nonblock nonblocking mode
-F, --period-time=# distance between interrupts is # microseconds
-B, --buffer-time=# buffer duration is # microseconds--period-size=# distance between interrupts is # frames--buffer-size=# buffer duration is # frames
-A, --avail-min=# min available space for wakeup is # microseconds
-R, --start-delay=# delay for automatic PCM start is # microseconds (relative to buffer size if <= 0)
-T, --stop-delay=# delay for automatic PCM stop is # microseconds from xrun
-v, --verbose show PCM structure and setup (accumulative)
-V, --vumeter=TYPE enable VU meter (TYPE: mono or stereo)
-I, --separate-channels one file for each channel
-i, --interactive allow interactive operation from stdin
-m, --chmap=ch1,ch2,.. Give the channel map to override or follow--disable-resample disable automatic rate resample--disable-channels disable automatic channel conversions--disable-format disable automatic format conversions--disable-softvol disable software volume control (softvol)--test-position test ring buffer position--test-coef=# test coefficient for ring buffer position (default 8)expression for validation is: coef * (buffer_size / 2)--test-nowait do not wait for ring buffer - eats whole CPU--max-file-time=# start another output file when the old file has recordedfor this many seconds--process-id-file write the process ID here--use-strftime apply the strftime facility to the output file name--dump-hw-params dump hw_params of the device--fatal-errors treat all errors as fatal
Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM SPECIAL S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE G723_24 G723_24_1B G723_40 G723_40_1B DSD_U8 DSD_U16_LE DSD_U32_LE DSD_U16_BE DSD_U32_BE
Some of these may not be available on selected hardware
The available format shortcuts are:
-f cd (16 bit little endian, 44100, stereo)
-f cdr (16 bit big endian, 44100, stereo)
-f dat (16 bit little endian, 48000, stereo)
录音设备查看:
**** List of CAPTURE Hardware Devices ****
card 0: rockchiprk809co [rockchip,rk809-codec], device 0: ff800000.i2s-rk817-hifi rk817-hifi-0 [ff800000.i2s-rk817-hifi rk817-hifi-0]Subdevices: 1/1Subdevice #0: subdevice #0
card 7: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]Subdevices: 8/8Subdevice #0: subdevice #0Subdevice #1: subdevice #1Subdevice #2: subdevice #2Subdevice #3: subdevice #3Subdevice #4: subdevice #4Subdevice #5: subdevice #5Subdevice #6: subdevice #6Subdevice #7: subdevice #7
card 7: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]Subdevices: 8/8Subdevice #0: subdevice #0Subdevice #1: subdevice #1Subdevice #2: subdevice #2Subdevice #3: subdevice #3Subdevice #4: subdevice #4Subdevice #5: subdevice #5Subdevice #6: subdevice #6Subdevice #7: subdevice #7
由此可见:录音设备有(card 0, device 0),命令指定录音设备表达为 -D hw:0,0
录音命令:
arecord -D hw:0,0 -d 2 -f cd -r 44100 -c 2 -t wav test.wav
arecord -D hw:0,0 -d 2 -f cd -c 2 -v -t wav test.wav
上面两种写法,其实效果是一样的,由使用说明(-f cd (16 bit little endian, 44100, stereo)可知,-f cd的采集频率已经是44100,已经包含了-r 44100的作用效果
-D 指定录音设备
-d 设置录音时长
-f 录音示例格式
-c 指定频道
-t 录音输出的文件类型
test.wav 输出文件的路径、名称
如果录音生成文件没有声音检查麦克风是否处于off状态:
输入命令
alsamixer
显示如下,右下角处显示MIC OFF就是麦克风处于关闭状态,需要将其打开,才能录到声音。
操作方法:
通过键盘的左右按键,选中MIC OFF项,
通过键盘的上下按键,将MIC OFF改为Main Mic,
Esc按键退出设置,再重新执行录音命令。
linux arecord录音相关推荐
- linux arecord 命令,如何使用arecord录音
如何使用arecord录音 arecord 是ALSA声卡驱动程序的命令行声音文件记录器. 它支持多种文件格式和具有多个设备的多个声卡. 如果以交错模式录制,文件将在2GB文件大小之前自动分割. 使用 ...
- arecord录音报错的解决办法
刚开始不是很懂arecord命令的使用和含义,导致录音总是报各种出错提示 今天我来梳理一下常见的几种报错 首先看看我的录音命令格式 arecord -D hw:2,0 -c5 -r16000 -fS1 ...
- linux arecord 命令,Linux命令行下怎样录音
在命令行输入以下命令可以录制麦克风声音: arecord demo.wav 如果想录立体声的CD音质,可以使用以下命令: arecord -f cd demo.wav 按CTRL+C可终止录音.执行p ...
- 录音权限 推送_友邻正式推出Linux版本录音系统
深圳市友邻通讯设备有限公司作为国内最早的呼叫中心应用软件提供企业之一,积极响应国家"关键核心技术自主可控"倡议,推出拥有完全自主知识产权.基于Linux开放平台的电话录音软件产品, ...
- linux 下录音alsa介绍
一.alsa-utils介绍 ALSA是kernel中的一个声音驱动程序.它包括alsa核心和其他声卡的驱动. alsa-utils是alsa的一个工具包,里面包含有声卡测试和音频编辑的工具. 二.a ...
- linux alsa 录音程序,转 alsa录音放音执行流程详解
前言: linux中,无论是oss还是alsa体系,录音和放音的数据流必须分析清楚.先分析alsa驱动层,然后关联到alsa库层和应用层. 链接分析: core/pcm_native.c文件中.mma ...
- linux查看录音驱动程序,linux驱动由浅入深系列:ALSA框架详解 音频子系统之二
本文以高通平台为例,介绍一下android下的音频结构.android使用的是tinyALSA作为音频系统,使用方法和基本框架与linux中常用的ALSA音频子系统是一致的. ALSA音频框架 ALS ...
- linux alsa 录音程序,Linux下alsa直接录音代码
[实例简介] 基于alsa,linux音频采集实现 [实例截图] [文件目录] AudioSamplingApp ├── AudioSamplingApp.cpp ├── AudioSamplingA ...
- linux下录音识别成文字软件下载,录音转文字分享助手
录音转文字分享助手是一款非常实用的录音软件,能够帮助用户在录音的同时可以快速的将内容转化成文字输出,不管是办公还是生活都可以进行使用,方便快捷,录制到好玩有趣的音频时还可以在录音转文字分享助手中一键进 ...
最新文章
- 图片增强深度学习deep learning keras
- 【转载】C#中StreamReader读取中文文本出现乱码的解决方法
- Android Nougat 有望本月到来:支持手动曝光调节
- web服务器文档根目录在哪里,web服务器根目录在哪
- 人工智能技术在智能制造中的典型应用场景与标准体系研究
- 基于java百货中心供应链管理系统(含源文件)
- (79)Verilog HDL系统函数和任务:$write
- SQL Server: create table sql script
- 02_入门程序(非注解方式,了解)
- 【GWT系列】实现远程过程调用
- 实战互联网公司数据存储解决方案
- python怎么修改默认路径_Python小知识之JupyterLab默认启动路径修改
- eclipse svn插件安装总失败 每次打开eclipse总提示 subversive svn connectors
- 《推荐系统实战(一)》基于统计的电影推荐系统(tmdb-5000数据集,数据清洗、特征提取、搭建模型等详细过程)
- Android按键之Menu详解
- 屠神-官方正版折扣端全面评测报告
- 丽台显卡测试软件,丽台Quadro FX4600专业显卡试用评测
- CHARACTERISTIC DEFINITION
- 帮推|阵容强大!请查收你的ASES线下宣讲会邀请函
- 戴尔 PowerEdge 14G 加速分布式存储解决方案 zData 提升性能