如何在Android中使用FMOD播放midi文件 [英] how to play midi file in android use fmod

查看:945
本文介绍了如何在Android中使用FMOD播放midi文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用FMOD播放MIDI文件。但有一个错误说:该插件需要的资源无法找到,(即用于MIDI回放DLS文件)

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)

我已经搜索结果类似这样的问题,并提到了fmod.h文件。看来,我需要一个名为gs_instrument.dls文件,但我无法找到它在我的Mac和Android的模拟器文件系统。我也无论是搜索的资源在网上,没有结果。

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.

所以,我该怎么办,如果我想使用FMOD的Andr​​oid播放midi文件。

So what should I do if I want to play midi file in android using fmod.

希望你能帮帮我!

谢谢!

推荐答案

我不知道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:

MediaPlayer mediaPlayer = new MediaPlayer();
File f = [... my MIDI file ...];
FileInputStream fis = new FileInputStream(f);
FileDescriptor fd = fis.getFD();
mediaPlayer.setDataSource( fd );
mediaPlayer.prepare();
mediaPlayer.start();

这篇关于如何在Android中使用FMOD播放midi文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆