A portable electronic device is provided. The portable electronic device includes a display configured to generate an input
signal in response to a user's touch,
wireless communication circuitry, memory storing one or more computer programs, and one or more processors communicatively coupled to the display, the
wireless communication circuitry, and the memory, wherein the one or more computer programs include computer-
executable instructions that, when executed by the one or more processors individually or collectively, cause the portable electronic device to receive a
user input from a hearable device through the display or the
wireless communication circuitry, based on the receiving of the
user input, determine whether the hearable device is worn by using a detection
signal received from the hearable device through the wireless communication circuitry, and perform a first function on a first
audio signal received from the hearable device through the wireless communication circuitry, based on determining that the hearable device is not worn or based on determining that the hearable device is worn and identifying that an ambient sound listening function which outputs a second
audio signal acquired from a
microphone of the hearable device to a speaker of the hearable device is being performed, or perform a second function on a third
audio signal being played through the hearable device, based on identifying that the hearable device is worn and identifying that the ambient sound listening function is not being performed.