Early diagnosis is crucial in the treatment of heart diseases. Researchers have applied a variety of techniques for cardiovascular disease diagnosis, including the detection of heart sounds. It is an efficient and affordable diagnosis technique. Body organs, including the heart, generate several sounds. These sounds are different in different individuals. A number of methodologies have been recently proposed to detect and diagnose normal/abnormal sounds generated by the heart. The present study proposes a technique on the basis of the Mel-frequency cepstral coefficients, fractal dimension, and hidden Markov model. It uses the fractal dimension to identify sounds S1 and S2. Then, the Mel-frequency cepstral coefficients and the first- and second-order difference Mel-frequency cepstral coefficients are employed to extract the features of the signals. The adaptive Hemming window length is a major advantage of the methodology. The S1-S2 interval determines the adaptive length. Heart sounds are divided into normal and abnormal through the improved hidden Markov model and Baum-Welch and Viterbi algorithms. The proposed framework is evaluated using a number of datasets under various scenarios.