Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sinch Call Recording Android

Can anyone please inform me that How to record the call either placed with callUser or callConference method in Sinch Android? The documents say contact us for recording but I haven't got any concrete solution regarding this as tried to contact but no response.

Apart from that, I tried recording call using MediaRecorder but there was an error MediaRecorder: start failed: -38 using all of the available AudioSources. Upon doing some research, I came to notice that Sinch is also using some internal AudioRecording which uses MIC. So, Whenever I try to record using MediaRecorder, it is failed as the Recorder Source is already in use.

Here is my code for recording:

private void initRecorder() {
    recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL); // I tried using MIC and everything but got the same error
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    recorder.setOutputFile(getFilename());
    recorder.setOnErrorListener(errorListener);
    recorder.setOnInfoListener(infoListener);

    try {
        recorder.prepare();
    } catch (Throwable e) {
        e.printStackTrace();
    }
}

private void recordCall() {
    try {
        recorder.start();
    } catch (Throwable e) {
        e.printStackTrace();
    }
}
like image 373
Yasir Tahir Avatar asked Oct 30 '22 04:10

Yasir Tahir


1 Answers

CAn you mail [email protected] again to enable call recording. In short Sinch SDK is using the recorder to record the mic and transmit it to the outer party, if you want to record the call it needs to be done serverside not client side. in i.e the connectConf action

https://www.sinch.com/docs/voice/rest/#ConnectConfAction

like image 152
cjensen Avatar answered Nov 15 '22 05:11

cjensen