Text this: Nonlinear dynamics of directed acoustic waves in stratified and homogeneous liquids and gases with~arbitrary equation of state