An electronic device, comprising: - a headphone amplifier configured for amplifying an audio signal (S Audio) provided at an audio input of the headphone amplifier to be provided to a headphone speaker load; - an impedance detection circuit, configured for receiving a test signal (S TP), processing the test signal (S TP) and detecting an impedance of the headphone speaker load by using the test signal (S TP) to generate a detection result (S DET); and - a first switch for selectively coupling the impedance detection circuit to the headphone speaker load; - a second switch for selectively connecting the audio signal (S Audio) to the audio input of the headphone amplifier; - a processor, coupled to the impedance detection circuit and configured - in an impedance detection state - to provide the test signal (S TP) to the impedance detection circuit, by closing the first switch providing a detection current (I' DET) to the headphone speaker load and by opening the second switch decoupling the input of the headphone amplifier from the audio signal (S Audio); - receiving the detection result (S DET) from the impedance detection circuit, - in an audio signal playback state - by opening the first switch decoupling the detection current (I' DET) from the headphone speaker load and by closing the second switch providing the audio signal (S Audio) to the input of the headphone amplifier and - adjusting a voltage of the audio signal to be provided to the headphone speaker load according to the detection result (S DET) of the impedance detection state. - a headphone amplifier configured for amplifying an audio signal (S Audio) provided at an audio input of the headphone amplifier to be provided to a headphone speaker load; - an impedance detection circuit, configured for receiving a test signal (S TP), processing the test signal (S TP) and detecting an impedance of the headphone speaker load by using the test signal (S TP) to generate a detection result (S DET); and - a first switch for selectively coupling the impedance detection circuit to the headphone speaker load; - a second switch for selectively connecting the audio signal (S Audio) to the audio input of the headphone amplifier; - a processor, coupled to the impedance detection circuit and configured - in an impedance detection state - to provide the test signal (S TP) to the impedance detection circuit, by closing the first switch providing a detection current (I' DET) to the headphone speaker load and by opening the second switch decoupling the input of the headphone amplifier from the audio signal (S Audio); - receiving the detection result (S DET) from the impedance detection circuit, - to provide the test signal (S TP) to the impedance detection circuit, by closing the first switch providing a detection current (I' DET) to the headphone speaker load and by opening the second switch decoupling the input of the headphone amplifier from the audio signal (S Audio); - receiving the detection result (S DET) from the impedance detection circuit, - in an audio signal playback state - by opening the first switch decoupling the detection current (I' DET) from the headphone speaker load and by closing the second switch providing the audio signal (S Audio) to the input of the headphone amplifier and - adjusting a voltage of the audio signal to be provided to the headphone speaker load according to the detection result (S DET) of the impedance detection state. - by opening the first switch decoupling the detection current (I' DET) from the headphone speaker load and by closing the second switch providing the audio signal (S Audio) to the input of the headphone amplifier and - adjusting a voltage of the audio signal to be provided to the headphone speaker load according to the detection result (S DET) of the impedance detection state.