The steps to complete this task are:
Press Windows + I to open the Settings app.
Hit Privacy > Microphone.
You will find a toggle switch under the “Allow apps to access your microphone” section.
If you want apps to have access to the microphone, activate it. If you want to block all apps from accessing the microphone, deactivate it.
Within the “Choose which Microsoft Store apps can access your microphone” section, you can block or allow microphone access for individual Microsoft Store apps.
The “Allow desktop apps to access your microphone” section features a toggle switch.
If you want desktop apps to access your microphone, turn it on. Otherwise, turn it off.