Search code examples
javaandroidandroid-mediaplayerrecordmicrophone

How to record microphone and media player in android


I need to record mic and media player together .it work.but when I connect handsfree in the device only record mic.i need to get media player voices and record it with mic. I need to mix voices from the media player and mic together

  recorder.setAudioSource(MediaRecorder.AudioSource.MIC)
                recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP)
                recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB)
                recorder.setOutputFile("/sdcard/Music/"+System.currentTimeMillis()+".amr")
                recorder.prepare()
                recorder.start()

Solution

  • Android does not support internal audio recording after android 7.0 Android only supports audio recording via microphone

    refer this

    and this