It could be your microphone and speakers interference. To check, right click the sound icon in notification area. Select recording devices. In the box that opens double click on 'internal microphone'. That should be the default. In the opened window select the levels tab. Under Microphone array you can either drop the recording sensitivity or, just to test, click on the speaker icon to disable for now. It should show a red circle with a diagonal line. Drop the microphone boost to 0.0db. If that was the problem then you can go back to the recording properties box and adjust accordingly so as not to get the interference but have the mic still available.
OnePlus 5 review