[UWP] No Sound in Voice Recording in Minimize state

Md. Niaz Mahmud 171 Reputation points
2022-09-08T10:37:11.147+00:00

Recording in app minimize state using Windows UWP Sample, AudioCreation, audiocreation. https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/audiocreation/ . There was no sound during inside recording when it was being recorded in minimize state. In maximize state of app, there was sound.

Is there any workaround so that I can record sound in app minimize state in UWP?

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Roy Li - MSFT 31,526 Reputation points Microsoft Vendor
    2022-09-09T03:12:24.717+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Is there any workaround so that I can record sound in app minimize state in UWP?

    Generally, when your UWP app is minimized, all the work will be suspended. This is expected behavior.

    If you want to make the audio recording work when the app is minimized, the simplest way is the enable the backgroundMediaRecording capability in the Manifest file. It's a Restricted capability which needs specific configuration in the Manifest file. Also, if you want to publish the app which uses Restricted Capability to the store, you will need to provide info during the app submission process in order to be approved.

    Here are the steps that I used in the official sample-audiocreation to enable the audio recording in minimized state:

    To enable this capability, please change the manifest like this:

       <Package  
             ...  
             xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"  
             IgnorableNamespaces="... rescap">  
             ...  
    

    Then find the Capabilities part of the manifest file, and add the backgroundMediaRecording capability. Due to the forum restriction. I could only post a image.

    239298-screenshot-2022-09-09-105627.png

    You could get more information about the Restricted capability here: https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations#restricted-capabilities

    Thank you.


    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful