DAC switching between built-in speakers and 6.35mm audio jack


For this build I have connected the 3.5mm jack connector of the Teensy 4.x Audio Board to some built-in speakers. I would like to include a 6.35mm jack connector, and for the Teensy 4.1 (which is connected to the audio board) to recognise when a 6.35mm jack is plugged in to the connector. When this happens, the built-in speakers should switch off and the audio should instead be output through the jack connector.

Does anyone know how I would do this?