- Ensure that VoiceOver is enabled.
- Ensure that the Screen Recording control is enabled in Settings>>Control Centre>Customize Controls.
- Ensure that audio out put is set to your device speaker.
- Activate the Control Centre and locate the Screen Recording icon.
- 3D press or double-tap and hold on this icon until the Screen Recording options panel appears.
- Ensure that the option to capture audio from the mic is enabled.
- Double tap on the button to start recording.
At this point, the screen recording will begin and audio output will switch to the device's earpiece.
This was not the case in previous iOS releases, where audio out put would continue through the device speaker.
It's possible that this change may be by design, but I cannot see a good reason for this to be the case.
Note that if you use the Control Centre to switch the audio destination back to your device speaker (either during the current screen recording or immediately after), any further screen recordings made for a short period afterwards will not switch audio to the earpiece when started. However, the behaviour described above will return if you come back at some later point to start a new screen recording.