Android Call Recording Issue in Marshmallow and Above Version
Asked Answered
T

0

6

I'm working auto call recorder app, I'm able to record voice call on below android Marshmallow using MediaRecorder.AudioSource.VOICE_CALL, From android marshmallow not able to record voice call using VOICE_CALL. I managed to record using MediaRecorder.AudioSource.MIC but here incoming voice not getting recorded and I want to record voice call in normal mode, not in speaker mode. I tried many examples and search a lot then I write this question. Please Help Me. There is an app on Google play that record both side voice in the call, Named "Call Recorder - Automatic Call Recorder" How it is working in marshmallow, Is there any other way to record the call?

    int Media;
    if (Build.VERSION.SDK_INT >= 24) {
        Media = MediaRecorder.AudioSource.VOICE_COMMUNICATION;
    }else if (Build.VERSION.SDK_INT==23){
        Media = MediaRecorder.AudioSource.MIC;
    }
    else{
        Media = MediaRecorder.AudioSource.VOICE_CALL;
    }

    CallRecord callRecord = new CallRecord.Builder(this)
            .setRecordFileName("")
            .setRecordDirName("CallRecord")
            .setRecordDirPath(Environment.getExternalStorageDirectory().getPath()) 
            .setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB)
            .setOutputFormat(MediaRecorder.OutputFormat.AMR_NB)
            .setAudioSource(Media) 
            .setShowSeed(true)
            .build();
    callRecord.startCallRecordService();
Terrorstricken answered 10/3, 2018 at 10:51 Comment(3)
Hi Kishor, I am also working on callRecording but not working in Above Marshmallow.Have you found solution on this.Can you please help me on this ?Monica
Which library have you used Kishor ?Monica
rooting a phone to make our app behave like system apps will be a solution? So that we can use MediaRecorder.AudioSource.VOICE_CALL to recordNeogene

© 2022 - 2024 — McMap. All rights reserved.