官方教程:http://ffmpeg.org/ffmpeg.html

录音方法:

开始找到了这个方法,但是不行呀,好像是没有这个oss吧。

oss 是linux 下的声音相关的东西,与alsa 一样,不过oss 是商业的, 而/dev/dsp 是oss 用到的麦克的设备吧

ffmpeg -f oss -i /dev/dsp wheer.mp3

ffmpeg -f oss -i /dev/dsp -ar  -ab  wheer.amr

采用 alsa-oss 录制,就可以啦

ffmpeg -f alsa -ac  -i hw:, out.mp3

ffmpeg -f alsa -ac  -i hw:, out.wav

科大讯飞的合成或者识别,保存成的音频文件格式是16k或者8k,16bit,单声道pcm格式的音频。采用以下方式录音

 ffmpeg -f alsa  -ar  -ac  -i hw: lib.wav

q——停止

但是 我使用以上命令时,提示说

cannot set channel count to 1 (Invalid argument)
hw:0: Input/output error

最后查阅资料,发现以下参数设置:

-ab bitrate 设置音频码率

-ar freq 设置音频采样率

-ac channels 设置通道 缺省为1

-an 不使能音频纪录

-acodec codec 使用codec编解码

如此按理说,去掉 -ac通道设置即可,运行以下命令:

 ffmpeg -f alsa  -ar 16000 -i hw:0 lib.wav
-acodec pcm_s16le

但还是无法识别,最后问了一下,是这样录音的:
ffmpeg -y -f alsa -i pluse -t :: -ar  -ac  lib.wav

其中

-y (global)
  Overwrite output files without asking. -f fmt (input/output)
Force input or output file format. The format is normally auto detected for input files and guessed from the file extension
for output files, so this option is not needed in most cases. -i url (input)
input file url -t duration (input/output) When used as an input option (before -i), limit the duration of data read from the input file. When used as an output option (before an output url), stop writing the output after its duration reaches duration. duration must be a time duration specification, see (ffmpeg-utils)the Time duration section in the ffmpeg-utils() manual. -to and -t are mutually exclusive and -t has priority.
//试试改改他的用法
ffmpeg -y -f alsa -i hw: -t :: -ar -ac lib.wav

这个可以了。

感谢

最新文章

  1. 【目录】本博客其他.NET开源项目文章目录
  2. How Tomcat works — 六、tomcat处理请求
  3. IBatis 配置一对多
  4. VMware搭建 sql server2012集群加节点 KB953748
  5. web 页面内容优化管理与性能技巧
  6. SSM框架
  7. [转]How to: Execute Oracle Stored Procedures Returning RefCursors
  8. 谈谈asp.net中的<% %>,<%= %>,<%# %><%$ %>的使用
  9. c++相关知识回顾
  10. Bottle 中文文档
  11. Spark_总结四
  12. 自学Python2.5-基本数据类型-set集合
  13. union 时只能查出一个表中的信息,另一个表只能查出字段
  14. SSIS-导入Excel文件时记录行号
  15. iOS开发之获取设备类型
  16. vue实现点击展开,点击收起
  17. 使用Fraps获取3D程序的FPS
  18. UOJ #30【CF Round #278】Tourists
  19. Python 时间获取
  20. “全栈2019”Java多线程第三十五章:如何获取线程被等待的时间?

热门文章

  1. nginx配置使其支持thinkphp的pathinfo模式
  2. MVC3.0,路由设置实现伪静态IIS中404错误
  3. 复杂事件处理引擎—Esper参考(事件部分)
  4. 07 - 删除vtkDataObject中的SetExtentTranslator 和 GetExtentTranslator方法 VTK 6.0 迁移
  5. 04 - 替换vtkDataObject中的GetPipelineInformation 和GetExecutive 方法 VTK 6.0 迁移
  6. log4net 学习笔记
  7. RAILS ON
  8. delphi 程序窗体及控件自适应分辨率(通过ComponentCount遍历改变字体大小以及上下左右)
  9. Basefragment的封装使用
  10. hibernate之关系映射上