How to find Leq for a WAV audio file like an SPL Meter would? Given an audio file (WAV), I need to find the $\rm L_{A_{eq}}$ (continuous A-weighted equivalent sound pressure level) of the audio file. For this purpose, I am following this workflow:


Get a frame of audio (say $0.125$ seconds of samples)
Scale the samples to find the $\rm SPL \ re \ 20 \ \mu Pa$ based on calibration factor obtained from a calibration tone.
Apply A weighting to the frame of audio data.
For each frame of audio data, find the SPL (dB) as:


$$
\begin{align}
\textrm{pressure}_{\rm Ref}    &amp;= 20\times10^{-6};\\
\textrm{amplitude}_{\rm rms}  &amp;= \sqrt{\rm mean( audData_1frame.^2 )};\\
\textrm{dBspl}_{\rm perFrame} &amp;= 20\times \log_{10}\left(\frac{\rm amplitude_{rms}}{\rm pressure_{Ref }}\right);\\
\end{align}
$$

This gives the $\rm SPL \ re \ 20 \ \mu Pa$ of a frame of data. This would be the Short $\rm L_{eq}$. 

How do I proceed further to get these 3 quantities:


$\rm L_{eq}$ = The total continuous equivalent sound pressure level. This wold be a scalar value for the entire audio file. If it has to be updated in a plot, how do we integrate the SPL of each frame with the previous frames?
$\rm L_{eq_{fast}}$ = Sound pressure level with $125\ ms$ time weighting
$\rm L_{eq_{slow}}$ = SPL with $1\ s$ time weighting
how do we integrate the SPL of each frame with the previous frames?


You're measuring the RMS value of the (filtered) samples, which is sqrt(average(samples^2)), so if you're finding the RMS value in multiple chunks, it would just be sqrt(weighted_average(chunk1^2, chunk2^2, chunk3^2, ...)) where the average is weighted by the number of samples in each chunk (typically they are all the same length, but maybe a recording is not an exact multiple of chunk size, for instance).

To find the time weighting, the signal flow is:


Apply A-weighting filter
Square the samples
Apply a low-pass filter with a real pole at 1/τ (where τ is 125 ms or 1 s in your case)
Square root
20*log10() of the signal to convert to dB


It's the same as the RMS of the weighted signal, above, except that instead of an unweighted average over the whole signal, you're using a sliding-time average (same as https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average I think).

The time-weighted SPL will be a signal, not a scalar for each frame.