简体   繁体   English

FMOD C# Wrapper 无法找到 fmod.dll(来自 Monogame 3.8)

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

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++).我正在尝试使用 dll 和 C# 包装器(似乎是从 C++ 自动生成的)将 FMOD Core 2.02 带入我的 Monogame 3.8 项目。 I've set the.dll's to Copy to the output directory on build, and I'm accessing them like so:我已将.dll 设置为复制到构建时的 output 目录,并且我正在像这样访问它们:

[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.到目前为止一切正常,可以从指针访问.dll。 However, once I go to create a new FMOD System using:但是,一旦我使用 go 创建一个新的 FMOD 系统:

FMOD.Factory.System_Create(out FMODSystem);

I get this error in a popup window:我在弹出窗口 window 中收到此错误:

The procedure entry point?setFadePointRamp@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@_KM@Z could not be located in the dynamic link library...fmod.dll.程序入口点?setFadePointRamp@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@_KM@Z 无法在动态链接库中找到...fmod.dll。

Followed by this error on the auto generated C# code itself:随后自动生成的 C# 代码本身出现此错误:

System.DllNotFoundException: 'Unable to load DLL 'fmod' or one of its dependencies: The specified module could not be found. System.DllNotFoundException:'无法加载 DLL'fmod' 或其依赖项之一:找不到指定的模块。 (0x8007007E)' (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.我确信.dll 被发现就好了,因为如果我故意弄乱了不正确的路径,那么第一个错误永远不会出现。

Has anybody successfully integrated FMOD with Monogame in 2021?有人在 2021 年成功地将 FMOD 与 Monogame 集成了吗? If so, please advise, would love any guidance on getting this up and running... don't want to be stuck with Monogame's MediaPlayer!如果是这样,请提供建议,希望获得有关启动和运行此功能的任何指导……不想被 Monogame 的 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我在这个主题上找到的其他资源(到目前为止没有一个对我有用): 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

Managed to solve this by reverting to an older release of FMOD, version 2.01.设法通过恢复到 FMOD 的旧版本 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.我会写一张票让 FMOD 团队知道,但我的希望并不高,因为他们似乎不太关心 Unity 之外的 C#。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM