Verify and configure privacy settings for audio apps
If the audio problem only happens while using particular applications, it's possible that the app's microphone permission has been disabled. This necessitates manually configuring the program to allow access to the microphone.
To do so, go to Settings-> Privacy-> Microphone then find and activate the issue app's permission.
After making the adjustments, restart your iPhone and check to see if the problem has been resolved.
Reset all settings
If your iPhone 8's microphone problem began after you installed updates, it's possible that it's a post-update issue that has to be addressed. Because certain updates supersede your current settings, it's conceivable that some audio or other relevant parameters were altered, resulting in this conflict. To exclude this as a possible cause, consider resetting all of your iPhone 8's settings. However, keep in mind that doing so will wipe your current settings sets and restore them to their default state. If this is OK with you, you may proceed to try this reset.
Go to Settings->General->Reset-> Reset All Settings on your iPhone 8 to reset all settings. Enter the proper passcode if required, then hit the option to confirm reset.
There will be no data loss during the procedure, so you don't have to be concerned.