I’m trying to extract spectral information using this GitHub - sunkin351/FmodAudio: C# .NET 5+ Wrapper for the Fmod audio library, but there is some information lacking on how to use it.
It implements the Fmod binaries and all underlying code.
I want to do something like (the params are slightly different from the official documentation, instead of 2 out params, it returns the result as a void*)
var res = fftPass.GetParameterData(index, out length)
but for the index parameter, I can’t find the [DSP::getNumParameters] object, so I am not sure what to pass in there. The result is probably(?) an IntPtr, and this result has to be converted via a Marshall.PtrToStructure(…) into a ParameterFFT object.
The block of code looks like this:
fftPass = System.CreateDSPByType(DSPType.FFT);
fftPass.Active = true;
fftPass.Bypass = true;unsafe
{
uint length;
IntPtr unmanagedData = (IntPtr)fftPass.GetParameterData(0, out length);
ParameterFFT fftdata = (ParameterFFT) Marshal.PtrToStructure(unmanagedData, typeof(ParameterFFT));
var spectrum = fftdata.Spectrum;}
What am I doing wrong apart from not knowing the index of the GetParameterData?
Any guidelines would be helpful, thank you.