fmod在ios64上无声音的问题

以前解决一个加载慢的问题时,发现fmod写的加载代码很差,尤其在android平台,做了很多无用功。

于是我就重写了fmod加载代码,使用www异步加载,加载的字节数组放在cache中,然后供fmod调用:

FMOD.RESULT result = FMOD_StudioSystem.sInstance.System.loadBankMemory(pair.Value,LOAD_BANK_FLAGS.NORMAL,out bank);

结果发现在ios上无法播放声音。

开始怀疑过il2cpp的问题,但是没有log,不能随便下定论。

添加过很多log后,定位到上面的函数出问题了,但是log中只记录执行到这里就没了。没有输出为什么错。

丝毫没有头绪后,在fmod官方发现有新版本了,下载新版本后,测试下,发现还是没有声音,但是至少有异常log了。

il2cpp暂时不支持从c/c++对c#进行调用,或者说至少不支持现在fmod的用法。

解决方法也很简单,修改为使用

	FMOD.RESULT result = FMOD_StudioSystem.instance.System.loadBankFile(bankPath, LOAD_BANK_FLAGS.NORMAL, out bank);

 

网上还有一个哥们遇到同样问题了,关注下看看他怎么解决。

http://forum.unity3d.com/threads/making-calls-from-c-to-c-with-il2cpp-instead-of-mono_runtime_invoke.295697/

 

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /opt/wordpress/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048