An electronic device comprises a
headset connecting port, a
processing unit, an audio encoding and decoding
chip, a first selector switch and a second selector switch, wherein the
headset connecting port comprises a left channel pin, a right channel pin, a grounding pin and a
microphone pin, the audio encoding and decoding
chip comprises a left channel output pin, a right channel output pin and a
microphone input pin, the left channel output pin is in electric connection with the left channel pin, the first selector switch comprises a first static contact, a second static contact and a first movable contact, the second selector switch comprises a third static contact, fourth static contact and a second movable static, the first movable contact is connected with the right channel pin, the first static contact is connected with the right channel output pin, the second movable contact is connected with the
microphone pin, the third static contact is connected with the microphone input pin, the fourth static contact is connected with a power input end of an adaptor, and the
processing unit comprises a detection pin and a switch control pin. The invention further provides a power supply
system supplying power through the
headset connecting port and a headset power line, and the number of connecting ports of an electronic device can be reduced.