The knowledge of the phase of STFT is a prerequisite for a successful signal reconstruction. However, the phase might be lost or no longer applicable depending on the kind of processing involved. We propose a real-time spectrogram inversion algorithm based on the relationship of the gradients of the phase and the logarithm of the magnitude and on the gradient integration theorem. We present a detailed comparison with the state-of-the-art phase reconstruction algorithms.