最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - Combine audio from MIC and system in Media Recorder - Stack Overflow

programmeradmin4浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论