I am not able to use fmod on Android since the bank files cannot be found.
I am strictly following the example code from https://github.com/dapetcu21/defold-fmod in order to read the bank files from bundled resource. The same example code works fine on Mac and Windows (I cannot test on iOS). Moreover I do remember I have used fmod on Android in my previous game with no issue at all (it was end of 2021).
The bank files are in /bundled_resources/android/assets/banks and if I unzip the apk I see that they are indeed in the subfolder assets/banks in the apk. As suggested by @dapetcu21 I try to load them with the absolute path
file:///android_asset/banks/
but fmod fails to load them and also io.open returns nil with the file.
As a side note, I see that sys.get_application_path() returns “/data/user/0/com.example.todo” on Android and this looks somehow strange to me… However, I am not using this path on Android but the absolute path reported above as suggested by dapetcu21. On Mac and Windows I use sys.get_application_path() to build the absolute path and filenames and it works fine.
So you have your banks in ./custom/common/audio/banks/* and in game.project you set the Custom Resources option to /custom/:
[project]
title = mygame
custom_resources = /custom/
Note that the /common part of the path is important since it means that the files and folders in /common will be included on all platforms. You can also have platform specific folders such as /custom/armv7-android (32-bit Android) and /custom/ios (iOS regardless of architecture).
Oh, I see now that you want to use Bundle Resources! Ok, what I’d start by checking is if the files end up in the apk. Unzip it and confirm that the banks are there. Please also share the path to where the banks are located inside the apk.
Yes, as I already said in my first post, I have checked that the banks are indeed in the apk, and they are in the right folders: if I unzip the apk I see the banks in game_name/assets/banks (game _name is the name of the game )
It was just a silly filename error: in the code I wrote an “i” instead of “I” in the filename of the fmod banks. So, I know, this makes me look completely stupid… and probably that is true.
BUT, but: what really puzzled me is that the game worked fine if launched from the editor! In the editor the fmod bank files are loaded EVEN IF their filenames are wrong…
I think I have an idea why there is this problem. A previous version of the same resource had as name the name of the actual resource with “i” instead of “I”. I think this puzzled the editor.