I have a problem with my screen recorder. When i use MediaRecorder.AudioSource.MIC, my output video will have smaller sound than the video played in device that i recorded. This is my attributes in Media Recorder:
private fun initializeRecorder() {
val (width, height) = getWindowSize()
mediaRecorder = MediaRecorder().apply {
setAudioSource(MediaRecorder.AudioSource.MIC)
setVideoSource(MediaRecorder.VideoSource.SURFACE)
setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
setOutputFile(getOutputFilePath())
setVideoSize(width, height)
setVideoEncoder(MediaRecorder.VideoEncoder.H264)
setAudioEncoder(MediaRecorder.AudioEncoder.AAC)
setAudioEncodingBitRate(AUDIO_BIT_RATE)
setAudioSamplingRate(AUDIO_SAMPLE_RATE)
setVideoEncodingBitRate(VIDEO_BIT_RATE_KILOBITS * 1000)
setVideoFrameRate(VIDEO_FRAME_RATE)
try {
prepare()
} catch (e: Exception) {
e.printStackTrace()
}
}
}
How can I record standard sound of system and sound in environment in output video? I want my sound in output video after recording is louder