Heart sounds and murmurs provide crucial diagnosis information for several heart diseases such as natural or prosthetic valve dysfunction and heart failure. Many pathological conditions of the cardiovascular system cause murmurs and aberrations in heart sounds. Phonocardiography provides the clinician with a complementary tool to record the heart sounds heard during auscultation. The advancement of intra-cardiac phonocardiography, combined with modern digital processing techniques, has strongly renewed researchers' interest in studying heart sounds and murmurs. This paper presents an algorithm for the detection of heart sounds (the first and second sounds, S1 and S2) and heart murmurs. The segmentation algorithm is based on the detection of the envelope of the phonocardiogram signal by the Hilbert transform technique, which is used to extract a smooth envelogram which enable one to apply the tests necessary for temporal localization of heart sounds and heart murmurs.