Author Topic: [Bass.net with Unity, Android] BASS_ERROR_FILEOPEN from BASS_PluginLoad...  (Read 380 times)

loom

  • Posts: 10
Hi,

I've been in the middle of some test with Bass.net on Unity. On the Unity Editor(Windows), I was able to take advantage of midi playback & sf2pack soundfont using BASS_PluginLoad("basswv.dll").
However, I'm getting BASS_ERROR_FILEOPEN from BASS_PluginLoad("[internal absolute path where I copied libbasswv.so to and confirmed the file exists in]/libbasswv.so") on Android device.

I used 'Bass.Net for .Net 2.0 (Bass.Net.dll)' for Unity Editor(Windows) and Android device and everything except BASS_PluginLoad was okay so far.
I tried 'Bass.Net for Xamarin.Android (Bass.Net.android.dll)' for Android device too, but the result wasn't different. And after that, I found Bass.Net.android.dll doesn't have BassWv.FreeMe() and BassWv.LoadMe()(Maybe I could list more methods which aren't included in Bass.Net.android.dll). I also want to know if this absence is intended on Bass.Net.android.dll and I could've got infomation regarding that kind of differences among assemblies from the document(or elsewhere).

I think Bass.net is an attractive solution to many Unity game developers targeting mobile(iOS, Android) and looking forward to find detailed instruction of how to use Bass library with Unity.

Please check into that. Thanks in advance.
« Last Edit: 14 Feb '18 - 02:15 by loom »

Ian @ un4seen

  • Administrator
  • Posts: 21358
Where is the libbasswv.so file located inside your app's APK file? It should be alongide the libbass.so file in "lib/armeabi", "lib/armeabi-v7a", "lib/x86" folders, according to the architecture. I'm not familiar with Unity, so I'm not sure how you would do it there, but in Java you can use "getApplicationInfo().nativeLibraryDir" to get the path at run-time:

Code: [Select]
int basswv = BASS.BASS_PluginLoad(getApplicationInfo().nativeLibraryDir + "/libbasswv.so");

In recent BASS releases, BASS_PluginLoad should also work if you just provide the filename without a path (assuming the library is at the proper location):

Code: [Select]
int basswv = BASS.BASS_PluginLoad("libbasswv.so");

loom

  • Posts: 10
In recent BASS releases, BASS_PluginLoad should also work if you just provide the filename without a path (assuming the library is at the proper location):

Code: [Select]
int basswv = BASS.BASS_PluginLoad("libbasswv.so");

Thanks again. It worked on Unity with an Android device.
I haven't tried it before because BASS.BASS_PluginLoad("basswv.dll") didn't work on Windows Editor of Unity. I had to put absolute location in front of "basswv.dll".
That behavior is hopefully from Unity rather than Bass or Bass .net.
« Last Edit: 19 Feb '18 - 02:57 by loom »