I don't think it's possible to get the "correlation" from the peak meter.
For intensity stereo recordings, the basic idea is to get, sample by sample, the sum and the difference between L & R values, (L+R, L-R), accumulate all the sum values and the difference values of the amplitude separatelly, and then compare the accumulated values.
If the sum is higher than the difference then probably there's no inversion.
The opposite isnt's true, for instance, if you have some instruments panned hard to the left and others panned hard to the right.
Stereo effects on intensity stereo recordings tend to raise the L-R component, too, leading to more false "inverted" results.
In those cases the hardly panned instruments will sound OK even when there's inversion, and only the center panned instruments (usually the voice) will be cancelled.
On recordings not based on intensity stereo (binaural, discrete, among others) the concept of phase inversion can't be applied.
Anyway, since most modern recordings are based on intensity stereo (for mono compatibility) and the instruments aren't usually hardly panned, the sum minus difference will probably be accurate enough to detect phase inversion.
I'm not a C# user, but I've done this in VB6 for my personal player. This is the simplified code:
Dim DiffAcc As Double, SumAcc As Double, ScanBytes As Long, hOv As Long, Buff() As Single
SumAcc = 0
DiffAcc = 0
hOv = BASS_StreamCreateFileAll(BASSFALSE, FileName, 0, 0, _
BASS_STREAM_DECODE Or BASS_SAMPLE_FLOAT)
ScanBytes = BASS_ChannelSeconds2Bytes(hOv, 0.1) '0.1 sec window
ReDim Buff(ScanBytes \ 4 - 1)
Do
BytesRead = BASS_ChannelGetData(hOv, Buff(0), ScanBytes)
If BytesRead > 0 Then
For X = 0 To BytesRead \ 4 - 1 Step 2
SumAcc = SumAcc + Abs(Buff(X) + Buff(X + 1))
DiffAcc = DiffAcc + Abs(Buff(X) - Buff(X + 1))
Next
Else
Exit Do
Endif
Loop
BASS_StreamFree hOv
MsgBox "Correlation = " & SumAcc / (SumAcc + DiffAcc + 1E-32)
Correlation will range from 1.0 (mono) to 0 (phase inverted mono). Values > 0.5 indicate probably not phase inverted recording.
Hope you get the idea.
There could be more sophisticated algorithms based on FFT phase component (you can get that using the BASS_DATA_FFT_COMPLEX flag), but I didn't get to explore that area.
Edit reason: typo