关于部分手机通话录音报start failed的问题
2016-06-16 16:04
453 查看
开发通话录音功能的时候,刚开始一切都很顺利,直到快发版的时候,发现了个问题,在华为的P8和Mate7上报错了,苦逼的程序员只能加班改bug,百度上看了一天,这个问题还挺常见的,一些人建议修改输出格式和频率,说是每个手机支持的格式和频率不同。然后,各种调试各种改,还是没用。
这个是我的代码:
mMediaRecorder.reset();
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);// 设置录音来源
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);// 设置输出格式
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);// 设置声音编码
mMediaRecorder.setOutputFile(record_file.getAbsolutePath());// 设置保存路径
mMediaRecorder.prepare();// 准备录音
mMediaRecorder.start();// 开始录音
最后把VOICE_CALL改成MIC就可以了
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
但是我要做的是通话录音,mic只能录制麦克风的声音!!
最后在网上找了下,说是有些手机不支持VOICE_CALL
这是文章链接:http://blog.sina.com.cn/s/blog_6a374983010162x2.html
而且系统拨号是支持通话录音的,所以应该还是有解决办法的,只是我们还没发现而已
相关文章推荐
- 【leetcode】172. Factorial Trailing Zeroes
- WSASocket failed 10013 处理
- 打开金蝶AIS文件方法
- Redis redis.clients.jedis.exceptions.JedisDataException: ERR Operation against a key holding the wr
- 转载http://jingyan.baidu.com/article/bad08e1e87138209c8512118.html
- AIDL进程间通讯的一些注意问题
- CDISC SDTM DS domain学习笔记
- oracle查看允许的最大连接数和当前连接数等信息(转自:http://blog.csdn.net/haiross/article/details/41944493)
- 钥匙串KeyChain的使用
- “机器学习”相关资料分享
- tail和head命令
- INS-35172 Target database memory(945MB) excessds the systems available shared memory({0}MB)
- 工作于内存和文件之间的页缓存, Page Cache, the Affair Between Memory and Files
- Paint House
- Openstack组件部署 — keystone(domain, projects, users, and roles)
- 2D Closest Pair Problem
- 朴素贝叶斯简易解释
- Intellij Idea essentails 翻译
- xiugai DNS
- 将main方法打成jar包,并引用第三方的maven jar包