Game Development Community

Using FMOD with T3D

by Keith Johnston · in Torque 3D Professional · 07/31/2009 (8:46 pm) · 14 replies

Does FMOD work with T3D? I downloaded the trial version of FMOD and dropped the DLLs into the same directory as the game. When I try to select FMOD as the sound provider I get tons of errors in the log like:

SFXFMODBuffer::SFXFMODBuffer - failed to create buffer
SFXProfile((null))::onAdd: The preload failed!
SFXFMODBuffer::SFXFMODBuffer - failed to create buffer
SFXSource::_create() - Could not create device buffer!
SFXSystem::createSource() - Creation failed!
  Profile: (null)
  Filename: (null)

#1
07/31/2009 (8:48 pm)
Also - how is that FMOD is so much cheaper through the GG store?
#2
07/31/2009 (11:08 pm)
Cheaper? The GG indie version looks to be the same as the FMOD hobbyist version. Same restrictions, same price tag. (See: www.fmod.org/index.php/sales/details/shareware)
#3
08/01/2009 (12:37 am)
@Matt: The EULA for FMOD on garagegames.com is *not* the same as FMOD's hobbyist version. The version on the FMOD site does not allow for commercialization, the one here does. I asked Brett (FMOD CEO) if he'd be willing to create a license similar to ours with Torque that would be affordable for developers on a smaller budget to use, but without stings down the road. To his credit, he was willing to give the lower pricing with a more liberal license a shot.

Many middleware companies won't do this, so FMOD deserves a lot of credit for supporting developers on a budget. They have the best audio package out there at any price, so I'm really happy to be able to make it available to this community at a price that makes sense for small teams and individuals.
#4
08/01/2009 (6:21 am)
Indeed!

Also to notice, that the library can be doanloaded for free from their site, as far as be for non-comercial use; so combinging both, we get a superb deal: integrate it, try it, and finally get it with a cool EULA at GG.com
#5
08/01/2009 (8:27 am)
I guess I should have started two threads - thanks for clarifying the license / price issue.

Any info on how to get it to work with T3D?
#6
08/01/2009 (9:01 am)
To clarify...On the FMOD (ex) site, the commercial license is $6000
for the "first" platform. On the garage games site there is a commercial
license for $500. This is the discrepancy we are inquiring about.

The garage games link is: http://www.garagegames.com/products/fmod

The fmod.org link is:
http://www.fmod.org/index.php/sales

(NOTE: click the "read more..." links for the prices for each type
of EULA)

~ Andy
#7
08/01/2009 (12:21 pm)
Quote:I guess I should have started two threads

It is some kind of cosmic law or something, related perhaps to Murphy's, that if you bring up multiple points in a forum thread, everyone will respond to the one you are least interested in getting a response to... ignore this law at your peril. lol
#8
08/01/2009 (8:35 pm)

Keith, yes, FMOD is supposed to work. This looks like a bug.

Can you modify the last section in the SFXFMODBuffer constructor like so:

FMOD_RESULT result = SFXFMODDevice::smFunc->FMOD_System_CreateSound(
         SFXFMODDevice::smSystem, 
         ( const char* ) NULL, 
         fMode, 
         pCreatesoundexinfo, 
         &mSound );
   if( result != FMOD_OK )
   {
      mSound = NULL;
      Con::errorf( "SFXFMODBuffer::SFXFMODBuffer - failed to create buffer (%i)", result );
   }
   else
      SFXFMODDevice::smFunc->FMOD_Sound_GetMode( mSound, &mMode );

and post what error you get from FMOD?

Also, do the profiles have common setups (like all being 3D sounds)?

Thanks.
#9
08/01/2009 (9:42 pm)
Here is the error code:

SFXFMODBuffer::SFXFMODBuffer - failed to create buffer (37)
SFXProfile(DeathCrySound)::onAdd: The preload failed!
#10
08/01/2009 (10:08 pm)
That's FMOD_ERR_INVALID_PARAM. Can't yet say what's going on but one thing I am suspecting is an ABI change in FMOD.

The FMOD headers in the Torque 3D lib directory are somewhat old (4.16) and there's possibly been an ABI change in the meantime that could cause troubles here. I'll update the headers for the next release.

If you want to try yourself, replace the things in Engine/lib/fmod and recompile.
#11
08/02/2009 (7:31 am)
That worked! Thanks!
#12
08/03/2009 (5:50 am)

Awesome.

Headers are updated.

#13
03/24/2010 (8:45 am)
I have a question. How to include FMODEvents, created in FMOD Designer, in the scripts? And how they can be connected?
#14
03/24/2010 (8:55 am)

For instructions on how to load your Designer project into Torque, see here.

Once you have done that, the SFXFMODEvents will be available as tracks like SFXProfiles or SFXPlayLists. As such, you can play them like other sounds in Torque by either using the SFX API directly (sfxPlayOnce, sfxCreateSource) or by assigning to the various places in Torque where sounds are used (player datablock, weapon states, etc).