在 Mono/Ubuntu 下播放 MP3 文件时 fmodex 返回 ERR_FILE_BAD

发布于 2024-09-01 22:35:51 字数 560 浏览 5 评论 0原文

我正在尝试使用 fmodex 4.30.03 在 Mono/Ubuntu 下播放 MP3 文件。

我对 createSound() 的调用如下所示:

result = system.createSound(path, 
    (FMOD.MODE._2D | FMOD.MODE.HARDWARE | FMOD.MODE.CREATESTREAM), 
    ref sound);

根据 SDK 附带的 C# 示例。

结果被设置为19,ERR_FILE_BAD

同样的事情在 Windows 下工作得很好。我在 app.config 中有以下内容:

<dllmap os="linux" dll="fmodex" target="./libfmodex-4.30.03.so"/>

如果不存在,则 fmodex 甚至永远不会被加载,所以我知道它已经完成了。

我传入的文件肯定存在,但如果我传递无效路径,我实际上会收到相同的错误消息。

I'm trying to use fmodex 4.30.03 to play an MP3 file under Mono/Ubuntu.

My call to createSound() looks as follows:

result = system.createSound(path, 
    (FMOD.MODE._2D | FMOD.MODE.HARDWARE | FMOD.MODE.CREATESTREAM), 
    ref sound);

as per the C# examples that come with the SDK.

result is being set to 19, ERR_FILE_BAD.

The same thing works fine under Windows. I have the following in app.config:

<dllmap os="linux" dll="fmodex" target="./libfmodex-4.30.03.so"/>

If this isn't present, fmodex never even gets loaded, so I know it's getting so far.

The file I'm passing in definitely exists, but if I pass an invalid path I actually get the same error message.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

末蓝 2024-09-08 22:35:51

我假设您已成功初始化 FMOD 系统以及所有内容。 C# 包装器将字符串作为 unicode 传递给 FMOD 以进行 createSound,而 FMOD 在 Linux 上不支持。要解决此问题,您需要更改 C# 包装器,删除传入的 FMOD_UNICODE 标志,并确保输入 FMOD 的字符串是正常的 ASCII。

I'm assuming you managed to get the FMOD system initialized and everything. The C# wrapper passes strings through to FMOD for createSound as unicode which FMOD doesn't support on Linux. To fix this you will need to alter the C# wrapper, remove the FMOD_UNICODE flag being passed in and ensure the strings being fed into FMOD are normal ASCII.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文