如何在android中使用fmod播放midi文件
我正在尝试使用 fmod 播放 midi 文件。但有一个错误说:找不到插件所需的资源(即用于MIDI播放的DLS文件)
我已经搜索了类似问题的结果,并参考了fmod.h文件。似乎我需要一个名为“gs_instrument.dls”的文件,但我在我的 Mac 和 Android 模拟器文件系统中找不到它。我也在网上搜索了资源,也没有结果。
那么如果我想在android中使用fmod播放midi文件该怎么办呢?
希望你能帮助我!
谢谢!
I am trying to play midi file using fmod. But there is an error says that :a resource that the plugin requires cannot be found,(ie the DLS file for MIDI playback)
I have searched results for problems like this,and referred to the fmod.h files. It seems that I need a file named "gs_instrument.dls" but I cannot find it in my mac as well as the android simulator filesystem. I have also searched the resources in the web,no result either.
So what should I do if I want to play midi file in android using fmod.
Hope you can help me!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道 fmod,但 Android 可以直接播放 MIDI 文件。这是对我有用的简化版本:
I don't know about fmod, but Android can play MIDI files right out of the box. Here's a simplified version of what works for me:
您可以使用传递到 System::createSound 的 FMOD_CREATESOUNDEXINFO 结构的 dlsname 成员来指定 DLS 文件的位置。
您必须自己提供实际文件并将其放在 SD 卡上,以便您可以传递它的位置。在 Windows 上,默认 DLS 文件位于“C:\Windows\System32\drivers\gm.dls”或“C:\Windows\System32\drivers\etc\gm.dls”。或者在 Mac 上,它位于“/System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls”。话虽如此,我无法谈论在 Android 项目中使用这些文件的合法性,您可能需要从其他地方获取您自己的“免费”dls 文件。
You specify the location of the DLS file with the dlsname member of the FMOD_CREATESOUNDEXINFO structure passed into System::createSound.
You must provide the actual file yourself and put it on the sdcard so you can pass in the location of it. On Windows the default DLS file is located at "C:\Windows\System32\drivers\gm.dls" or "C:\Windows\System32\drivers\etc\gm.dls". Alternatively on Mac it is located at "/System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls". This being said I cannot speak to the legality of using these files in an Android project, you may need to source your own "free" dls file from somewhere else.
你可以像这样使用。您可以在要播放 midi 文件的地方调用以下方法。
You can use like this. You can call following method where you want to play midi file.