I'm working on FMOD Studio bindings for Java, is this valuable to anyone?

(Is this the right place for this post?)

I have FMOD working in my game, via JNI. Here is the project on github:

It’s in an incomplete/experimental state right now, but it does work and allows my sound designer to work in FMOD studio and see the results (live!) in game.

If this is of interest to anyone, please let me know what part of the api is important to you. What features would you want to see before you’d consider using it?

I use FMOD a couple of years ago in my java games because it was THE standard when it comes to sound playback in video games.
Back then there was a binding called org.jouvieje.FmodEx
Not sure if that still exists, I also recall some licensing issue with that or FMOD later on.

So basically I have been using OpenAL for a long time and never really missed anything and almost never saw anyone talk about FMOD on here.
Which is inherently a little strange to me, just like Bink video and Havok physics these are proven standards of the game industry. But I guess the lack of java binding makes it impossible to care about those.

tl;dr I would guess unfortunately that not a lot of people will care about this, although they should since I see no reason to use anything other than FMOD or OpenAL personally.

very appreciated. jouvieje’s bindings are very outdated - but still good enough.

would love to use a swig’ed version. atm visual studio is required to get it to work ?

You don’t need visual studio to use fmod-jni on windows, if you use the wrapper dlls that I built. All you need is the FMOD API, which you can download, and a java build environment to wrap all of the dlls and java wrapper code into a self-contained jar. I’m doing it this way because I don’t want to be distributing FMOD.

If you want to use other platforms, you’ll need to build the wrapper libraries for those platforms, and add them to the JAR. There’s code in the wrapper to work across platforms, but I’ve only tested on windows.

If you give it a shot, let me know if you run into any problems.

excellent!

works pretty good. back when - jouvieje’s implementation did not support the studio. very cool of you to pick that first to implement.

first trouble i ran into, using non-blocking bank-loading (which seems to work using [icode]FMODConstants.FMOD_STUDIO_LOAD_BANK_NONBLOCKING[/icode]) : i cannot create a [icode]SWIGTYPE_p_FMOD_STUDIO_LOADING_STATE[/icode] instance to feed into [icode]FMOD.FMOD_Studio_Bank_GetLoadingState(bank.getPointer(),state)[/icode] … to test it.

anyway, looks like that should go into the [icode]Bank[/icode] class at some point. maybe i’m just not used to the code yet tho’.

i really hope you continue this project and get some more people contributing. my experience with swig is too basic to be any help.

openAL is super good for simple sound playback. everything fancy is easy to code just in java. fmod comes with alot out of the box. (bus, groups, dsp, culling, balance, occlusion, etc). looking on the fmod-studio it’s clearly ment to be used with bigger projects - separating the sound-design from the game and game-engine. overkill for most demos i guess.

o/

asio 2.0 output works great.

initialising the studio-system with systemFlags [icode]FMODConstants.FMOD_INIT_NORMAL | FMODConstants.FMOD_INIT_PROFILE_ENABLE[/icode] allows the fmod-profiler to connect, which is awesome.

driver-enumeration works pretty ok too. using [icode]FMODJNI.FMOD_System_GetDriverInfo[/icode] - only data i cannot retrieve is the driver-name. not too important but the jni-method-signature does not match the documentation : http://www.fmod.org/documentation/#content/generated/FMOD_System_GetDriverInfo.html expects a [icode]FMOD_GUID[/icode] pointer, but the JNI version expects a pointer and the guid-java-object. doesn’t break the guid data tho’.

atm it’s pretty sufficient to use the [icode]FMODJNI[/icode] class alone. for that i had to expose most of the internal [icode]swigCPtr[/icode] fields, like in the SWIGTYPE_p_FMOD_SYSTEM class. maybe you could just expose it with a getter.

o/

I noticed this thread and thought I’d add: I have been working on bindings as well, although mine are for the low-level API rather than for the Studio. They are here: https://github.com/Tinytimrob/JFmod5

I don’t like SWIG, I think it adds too much ugly overhead, so I was writing the JNI by hand. Most of the stuff is currently incomplete, although enough is implemented right now to get the sound working in my next game.

I would love to see a more feature complete binding of FMOD 5/Studio, because the jouvieje bindings for FMOD 4 (https://github.com/jerome-jouvie/NativeFmodEx) are really outdated and don’t qualify for the free indie license :frowning: