Game Development Community

dev|Pro Game Development Curriculum

Torque EAX Support

by Kurtis Seebaldt · 09/03/2003 (1:31 pm) · 9 comments

Download Code File

This patch will fix Torque's EAX support. I fixed all the AudioEnvironment and AudioSampleEnivronment
stuff to work with EAX 2.0. I can only get it to link on Win32 so i added some #ifdef statements to
conditionally compile it in.

How to:
patch your source using eax.patch
#define EAX (either in audio.cc directly, or in your project settings)

Clean and rebuild. When you run it you should see something like this in the console output:

OpenAL Driver Init:
OpenAL
EAX Enabled.
   Vendor: Creative Labs Inc.
   Version: OpenAL 1.0
   Renderer: Software
   Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3


The third line should say "EAX Disabled" or "EAX Enabled".


As an example on how to use it, I've included a modified trigger datablock called "EnvironmentTriggerData".
It adds one field to "TriggerData" called "audioEnvironment". It should be set to an AudioEnvironment datablock.
onTriggerEnter() will set the environment to the AudioEnvironment settings. onTriggerExit() will reset the
environment back to the default. To use it, copy "trigger.h" and "trigger.cc" over the old version.


I've also included some scripts that define a bunch of AudioEnvironment and AudioSampleEnvironment datablocks.
exec() these in the appropriate place (init.cs for client, game.cs for server).

AudioSampleEnvironment defines environment settings for individual sound sources. I've included two.

datablock AudioSampleEnvironment(SampleEnvironmentNormal)
{
   room = 0;
   roomHF = 0;
   airAbsorption = 1.0;
};

datablock AudioSampleEnvironment(SampleEnvironmentNone)
{
   room = -10000;
   roomHF = -10000;
   airAbsorption = 0.0;
};


SampleEnvironmentNormal are the default environment settings. SampleEnvironmentNone are settings that will
disable environment effects. This one is good for GUI sounds or background music. To use them, add them to
your AudioProfile like this:

datablock AudioProfile(RifleFireSound)
{
	filename = "~/data/sound/mgunfire.wav";
	description = AudioDefault3d;
	preload = true;
	environment = "SampleEnvironmentNormal";
};

#1
09/05/2003 (7:24 pm)
Do you have to pay to have EAX, if you use it in a game?
#2
09/05/2003 (8:25 pm)
At least with EAX 2.0, I'm pretty sure you don't. All the info is freely available and its accessed just as properties in DirectSound and OpenAL.
#3
09/16/2003 (5:36 am)
Is there a version of this that also has the changes made for ogg support?
#4
09/27/2003 (3:04 pm)
Question....
Any chance of this getting merged into the HEAD? =)
#5
09/30/2003 (9:02 am)
I'll try and work on making a new patch off the new HEAD with all the Ogg goodies in it.
#6
09/30/2003 (11:56 am)
send patch to me ricko@garagegames.com
#7
11/14/2003 (6:42 am)
Great resource. Works great in stand alone mode but not in dedicated server mode. If you are connecting to a dedicated server the EAX will not work.
#8
03/16/2005 (1:02 pm)
Would really love to get EAX working with Torque but don't know how to set up the patch to work. Any help?
#9
08/27/2005 (9:08 pm)
Does this fix still allow environments to be defined (normaly) within a interior or waterblock etc, instead of the odd placement on the audio profile itself?

Normaly I would think one would just assign the AudioEnvironments to the interiors and other objects, then set the environment level on a audio description OR audio profile basis.

/me makes a pathetic attemp to resurrect an old subject long need of coverage.