Call Recorder Issue- Xamarin.Android

SrimanSriman INMember ✭✭

I am using MediaRecorder class library to develop app for recording voice calls. I am using Moto G mobile (API Level 21) for USB Debugging. After making call, I start to record with below code. It ends up in exception and breaks at recorder.Start(). It creates a file but it doesn't contain any audio and it is zero bytes dummy file.

public MediaRecorder recorder = new MediaRecorder();

Start Call Record:

recorder.Reset();
recorder.SetAudioSource(AudioSource.VoiceCall);
recorder.SetOutputFormat(OutputFormat.ThreeGpp);
recorder.SetAudioEncoder(AudioEncoder.Aac);
recorder.SetOutputFile("/sdcard/Download" + "/123.amr");
recorder.Prepare();
recorder.Start(); // Exception Hits

End Call Record

recorder.Stop();
recorder.Release();
Permissions:






Can, anyone help me to solve this issue?

Tagged:

Answers

  • YkshLeoYkshLeo USMember ✭✭✭✭

    You are given the Output format as : recorder.SetOutputFormat(OutputFormat.ThreeGpp);.
    But when you set the output path it is given as : recorder.SetOutputFile("/sdcard/Download" + "/123.amr");

    Modify it as : recorder.SetOutputFile("/sdcard/Download/123.3gpp");

Sign In or Register to comment.