FMOD C# Wrapper unable to find fmod.dll (from Monogame 3.8)

368 views Asked by At

I'm attempting to bring FMOD Core 2.02 into my Monogame 3.8 project using the dll's and C# wrappers (which appear to be auto-generated from the C++). I've set the .dll's to Copy to the output directory on build, and I'm accessing them like so:

[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string path);

public void OnSystemLoad()
{
    if (Environment.Is64BitProcess)
        LoadLibrary(System.IO.Path.GetFullPath("FMOD\\x64\\fmod.dll"));
    else
        LoadLibrary(System.IO.Path.GetFullPath("FMOD\\x86\\fmod.dll"));
}

Everything's working just fine up to this point, the .dll's accessible from the pointer. However, once I go to create a new FMOD System using:

FMOD.Factory.System_Create(out FMODSystem);

I get this error in a popup window:

The procedure entry point ?setFadePointRamp@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@_KM@Z could not be located in the dynamic link library ...fmod.dll.

Followed by this error on the auto generated C# code itself:

System.DllNotFoundException: 'Unable to load DLL 'fmod' or one of its dependencies: The specified module could not be found. (0x8007007E)'

I'm confidant that the .dll is being found just fine, because if I intentionally mess with the Path to something incorrect then the first error never appears.

Has anybody successfully integrated FMOD with Monogame in 2021? If so, please advise, would love any guidance on getting this up and running... don't want to be stuck with Monogame's MediaPlayer!

Other resources I've found on this subject (none of which have worked for me so far): https://mysteriousspace.com/2015/05/31/fmod-in-c-its-a-pain-to-set-up-heres-how-i-did-it/ https://github.com/Martenfur/ChaiFoxes.FMODAudio

1

There are 1 answers

3
bbbppp On

Managed to solve this by reverting to an older release of FMOD, version 2.01.

I'll write a ticket to let the FMOD team know, but my hopes aren't high, since they don't seem to care much for C# beyond Unity.