Acoustic cavitation is the expansion and contraction of existing microbubbles in liquids brought on by an ultrasonic field. The dynamics of oscillations at higher pressures and temperatures when the cavitation bubbles collapse can be used to characterize cavitation dynamical behavior. This work deals with the theoretical and numerical investigation of acoustic cavitation in viscoelastic media considering the influence of ultrasound frequency. An acoustic pressure equation combined with a modified Rayleigh–Plesset equation forms the theoretical framework for ultrasound cavitation dynamics. The numerical solutions of the given cavitation bubble model were obtained taking into account the effect of acoustic pressure, using the exponential B-Spline collection method. The dynamics of the cavitation bubbles' radius and the internal pressure of acoustic cavitation were examined at different values of viscosity and the impact of physical parameters on the monatomic, diatomic, and adiabatic gas-filled spherical bubble's collapse dynamics for (k = 7/5, 5/3, 1) respectively.