mMediaRecorder = new MediaRecorder();
/*jicong.wang modify for sprd second mic test start @{*/
if(!TextUtils.isEmpty(mDevicePlatform) && "sprd".equals(mDevicePlatform)) {
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
} else {
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
}
/*jicong.wang modify for sprd second mic test end @}*/
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
mMediaRecorder.setAudioSamplingRate(1);
mMediaRecorder.setAudioChannels(1);
mMediaRecorder.setOutputFile(file.getAbsolutePath());
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mMediaRecorder.setAudioEncodingBitRate(96000);
mMediaRecorder.prepare();
mMediaRecorder.start();
int ratio = mMediaRecorder.getMaxAmplitude();
LogUtil.d("ratio:"+ratio);
int db = 0;// 分贝
if (ratio > 1)
db = (int) (20 * Math.log10(ratio));
mMIC.setText(String.format((getResources().getString(R.string.record_mic)),db));
if(db>maxMIC){
maxMIC = db;
}
最后
以上就是受伤老虎最近收集整理的关于sprd 主副mic测试的全部内容,更多相关sprd内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复