Get code example to forward audio from computer mic to phone in scrcpy library. You can use microphone jack to transfer audio but there is another solution. Check this code –
The best solution currently is to connect the device via bluetooth to the computer. It works for all apps, it does not suffer from additional limitations and works for basically all devices.
Source: @rom1v