Acoustic heart signals, generated by the mechanical processes of the cardiac cycle, carry significant information about the underlying functioning of the cardiovascular system. We describe a computational analysis framework for identifying distinct morphologies of heart sounds and classifying them into physiological states. The analysis framework is based on hierarchical clustering, compact data representation in the feature space of cluster distances and a classification algorithm. We applied the proposed framework on two heart sound datasets, acquired during controlled alternations of the physiological conditions, and analyzed the morphological changes induced to the first heart sound (S1), and the ability to predict physiological variables from the morphology of S1. On the first dataset of 12 subjects, acquired while modulating the respiratory pressure, the algorithm achieved an average accuracy of 82±7% in classifying the level of breathing resistance, and was able to estimate the instantaneous breathing pressure with an average error of 19±6%. A strong correlation of 0.92 was obtained between the estimated and the actual breathing efforts. On the second dataset of 11 subjects, acquired during pharmacological stress tests, the average accuracy in classifying the stress stage was 86±7%. The effects of the chosen raw signal representation, distance metrics and classification algorithm on the performance were studied on both real and simulated data. The results suggest that quantitative heart sound analysis may provide a new non-invasive technique for continuous cardiac monitoring and improved detection of mechanical dysfunctions caused by cardiovascular and cardiopulmonary diseases.