In this talk we present an extension of the arithmetic Hilbert-Samuel formula of Gillet-Soul ́e. This formula provides an asymptotic estimate of the covolumes of lattices of integral sections of powers of a positive hermitian line bundle on a projective arithmetic vairety. The leading coefficient is the height of the variety defined by Bost-Gillet-Soul ́e. The original formulation of this result assumes that the metric on the line bundle is smooth. Therefore, natural examples such as automorphic line bundles on compactifications of Shimura varieties cannot be considered: their natural metrics are no longer smooth near the boundary. This is the case of modular forms with their Petersson metric. We will present a new statement that covers a significant part of these examples. Our generalization allows to deal with the most general class of singular metrics for which the covolumes and height can be defined, the so-called metrics of finite energy. We will give an idea of the proof, relying on fundamental facts of pluripotential theory and positivity of direct images in K ̈ahler geometry. The contents of this talk will be based on join work with Robert Berman (Chalmers University, G ̈oteborg, Sweden).