Thermodynamic method for measuring the B/A nonlinear parameter under high pressure