question

UniversalCamera-5217 avatar image
0 Votes"
UniversalCamera-5217 asked YonglunLiu-MSFT commented

Record Room Audio during a Phonne Call

My Xamarin.Forms App works great for recording Room Audio but produces total silence recording during a Phone call...

. if (mediaRecorder == null)
{
Task.Run(() =>
{
var path = new File(Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryMusic), "Audio_Recorded.3gp");
mediaRecorder = new MediaRecorder();
mediaRecorder.Reset();
mediaRecorder.SetAudioSource(AudioSource.VoiceCommunication);
mediaRecorder.SetOutputFormat(OutputFormat.ThreeGpp);
mediaRecorder.SetAudioEncoder(AudioEncoder.AmrNb);
mediaRecorder.SetOutputFile(path.AbsolutePath);
mediaRecorder.Prepare();
mediaRecorder.Start();// Recording is now started
});
}

Following Run-Time Permissions are being Granted except for ... Manifest.Permission.CaptureAudioOutput,

     public static string[] PERMISSIONS_REQUIRED =
     {
         Manifest.Permission.Camera,
         Manifest.Permission.WriteExternalStorage,
         Manifest.Permission.CaptureAudioOutput,
         Manifest.Permission.ModifyAudioSettings,
         Manifest.Permission.RecordAudio,
         Manifest.Permission.WakeLock,
         Manifest.Permission.AccessNetworkState,
         Manifest.Permission.ReadExternalStorage
     };

Does my Silent Recording stem from improper Permissions? If so how to resolve Manifest.Permission.CaptureAudioOutput.

If its another issue then how do I fix That????

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YonglunLiu-MSFT avatar image
0 Votes"
YonglunLiu-MSFT answered YonglunLiu-MSFT commented

Hello,

produces total silence recording during a Phone call...

Referring to the official documentation about MediaRecorder, we can find that:

Capturing from VOICE_CALL source requires the Manifest.permission.CAPTURE_AUDIO_OUTPUT permission. This permission is reserved for use by system components and is not available to third-party applications.

That's the reason the issue occurs.

Best Regards,

Alec Liu.



If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 10
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

can you please tell me how i can meet my objective of room recording during phone call

thank you!

0 Votes 0 ·
YonglunLiu-MSFT avatar image YonglunLiu-MSFT UniversalCamera-5217 ·

It's no possible to record phone calls using a regular app by conventional means.

As the documentation says, this permission is not available to third-party applications.

This feature will compromise the security of the system, therefore, we could not to provide the solution about it.

If it is useful for you, could you please mark this answer? It would be helpful for others who meet the same issue.:)

0 Votes 0 ·

I am not interested in the phone call...I am only interested in the room. So how can i record room during a phone call? Off course I can carry a second phone and use that as a room recorder. But I don't want to carry two phones!!!!

Help will be Kindly appreciated. By the way my source is MIC not VOICE_CALL.

Thank You!!!!!!!!!!

0 Votes 0 ·
Show more comments