Hi everyone!
Its been years since I've posted. Not prepared to even say what i'm working on, but I'm trying to use replaygain.dll (off Rarewares) via C# interop. Ever time I call GetTitleGain(), it returns 64.82. From a quick google search, it seems that means i've encountered an error.
Here is my p/invoke signature:
[DllImport("replaygain.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern int InitGainAnalysis(long sampleFreq);
[DllImport("replaygain.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern int AnalyzeSamples(float[] leftSamples, float[] rightRamples, UIntPtr numSamples, int numChannels);
[DllImport("replaygain.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern float GetTitleGain();
and then i'm basically calling:
float[] leftSamples = new float[4096];
float[] rightSamples = new float[4096];
// Code to initialize the samples, somewhere between -1 and 1.
InitGainAnalysis(sampleRate)
AnalyzeSamples(leftSamples, rightSamples, new UIntPtr((ulong)sampleCount), 2);
float replaygain = GetTitleGain(); // Always returns 64.82 after at least 1 call to AnalyzeSamples.
Anyone else tried this from C#? Am I missing anything? Alternatively, is there another ReplayGain library to suggest, preferably with multi-channel and >48khz support?