A new method to calculate the thermodynamical properties of liquids from accurate speed-of-sound measurements