Метод setProfile () MediaRecorder

мы можем увидеть, если:
profile.quality >= CamcorderProfile.QUALITY_TIME_LAPSE_LOW //1002
&&
profile.quality <= CamcorderProfile.QUALITY_TIME_LAPSE_QVGA //1007
там не будет setAudio * () Так что в вашемкод, который вы можете вручную установить profile.quality=[any int from 1002 to 1007]
до setProfile()
.Это будет работать, я пытался.
Я нашел правильный ответ:
if (getIsMuteShooting()) { // with out audio
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setVideoFrameRate(profile.videoFrameRate);
mRecorder.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
mRecorder.setVideoEncodingBitRate(profile.videoBitRate);
mRecorder.setVideoEncoder(profile.videoCodec);
} else {
mRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setVideoFrameRate(profile.videoFrameRate);
mRecorder.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
mRecorder.setVideoEncodingBitRate(profile.videoBitRate);
mRecorder.setAudioEncodingBitRate(profile.audioBitRate);
mRecorder.setAudioChannels(profile.audioChannels);
mRecorder.setAudioSamplingRate(profile.audioSampleRate);
mRecorder.setVideoEncoder(profile.videoCodec);
mRecorder.setAudioEncoder(profile.audioCodec);
}