If your Mac switches to a different audio device
When using an external display, if your audio output or input immediately reverts to a different audio device than the one you selected in Sound preferences, do any of the following:
If you have headphones or external speakers plugged into a Mac connected to a display: When you select the display’s built-in speakers in the Output pane of Sound preferences, your selection may revert to the headphones or external speakers. To select the display’s speakers, first unplug the headphones or external speakers, then make your selection.
If you have a headset plugged into a Mac connected to a display: When you select the display’s built-in microphone in the Input pane of Sound preferences, your selection may revert to the headset. To select the display’s built-in microphone, first unplug the headset, then make your selection.