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.
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.