Since many years ago, ultrasonic velocity has been used to investigate the physical and mechanical behaviour of rocks, thereby playing an important role in reservoir characterization and seismic interpretation. In order to develop the knowledge of ultrasonic tools, I performed a noble analysis on the ultrasonic behaviour of rocks under confining stress and evaluated a distinctive property of porous media that is measured as the area under the stress–velocity curve (here defined as S*). I further investigated its relationship with elastic and mechanical behaviours of rock. To validate the theoretical framework developed in this work, 20 core plugs from various rock units with complex microstructures were subjected to triaxial compressional tests to calculate their area under the curve. Calculations were made for crack-closing, elastic and post-elastic stages (e.g. pore collapse) along the ultrasonic velocity–stress curve. Moreover, the selected samples had their microstructure investigated by thin-section studies to quantify their porosity and pore type. The results were analysed to check for the effect of pore type on S* in different stages of the stress–velocity curve. Based on the outputs of the analysis of variance and Pearson's correlation coefficient analysis, the curve had its shape and underlying area closely related to the porosity and pore geometry. Indeed, the results showed that the shale and sandstone with micro cracks and carbonate with stiff pores correspond to smaller and larger areas under the curve in crack-closing and inelastic stages, respectively. Cross-correlating the results to compressibility (inverse of bulk modulus), it was figured out that the calculated area under curve was well consistent with the compressibility. In addition, S* represents both static and dynamic behaviours of the rock, and the results revealed that the shape and curvature of the stress–velocity curve give valuable information about the rock microstructure. Another finding was the fact that the type of fluid and wave velocity seemingly affect the S*. Our findings can help interpret wave velocity behaviour in reservoir rocks and other stressful porous media.