Phonocardiography provides the clinician with a complementary tool to record the heart sounds heard during auscultation. This paper presents an algorithm for the detection of heart sounds (the first and second sounds, S1 and S2) and heart murmurs. Secondly the heartbeat cardiac sounds represented by the phonocardiogram (PCG) signal once segmented is one of the useful approaches to explore cardiac activity and extract many features to help researchers develop techniques that can be used for the medical treatment of several heart diseases. For people affected by a heart activity problem, it is a serious health problem that requires special care. In this paper, importance is given to heart murmurs and their severity to show their impact on heart rate. Heart murmurs are very widespread pathologies in the world and depending on their severity they could constitute. This paper is concerned to the segmentation of heart sounds by using state of art Hidden Markov Models technology which used to extract a smooth envelogram which enable us to apply the tests necessary for temporal localization of heart sounds and heart murmurs.