A method for providing contents and an electronic device having a function therefore is disclosed. The method comprises receiving information regarding a current heart rate of a user, selecting an audio file having a specific tempo determined in consideration of the current heart rate and a reference heart rate, and reproducing the selected audio file and a heartbeat sound reflecting the current heart rate simultaneously. Therefore, the heartbeat of the user may be effectively controlled.