I want to perform aec on a wav file and calculate erle
You could use cross correlation for this purpose. For an uncorrelated signal $x(t)$, $\textrm{corr}(x(t), x(t + \Delta t)) = c \delta(\Delta t)$, i.e. an delayed impulse. This can be expanded to comprise multiple echoed copies
$$ \textrm{corr}\left( \sum_{i=0}^{N} a_i x(t + \Delta t_i), \sum_{j=0}^{N} b_j x(t + \Delta t_j) \right)  = 
c \sum_{i=0}^{N} \sum_{j=0}^{N} a_i b_j \delta(\Delta t_i - \Delta t_j) $$
I remember from highschool physics books that if a delay is less than a certain amount, associated with the low frequency human hear response, (say 0.1 second), then it is not echo, it is reverberation. More objectively we could say that the audio signal will have a cross correlation that vanishes for lags larger than $L_x$.
You can have a measurement of the echo energy by the sum of the cross correlation with lag longer than $N_e$ from the maximum correlation. The maximum correlation will also provide a reference for synchronization of the two audio signals.
Putting this together you end up with a code like this
def measure_echo(a1, a2 = None):
    corr = signal.correlate(a1, a2 if a2 is not None else a1)
    lags = signal.correlation_lags(len(sig), len(sig_noise))
    # find the peak correlation (synchronize the signals)
    center = np.argmax(np.abs(corr)) 
    return np.sum(np.abs(corr**2))/np.sum(np.abs(corr[center-Ne+1:center+Ne]))