Game Development Community

EAX Usage questions

by Alex Huck · in Torque Game Engine Advanced · 12/04/2006 (12:35 pm) · 1 replies

Hi, I can't figure out how to implement a Audio Environment, here is what's in my newly created "Sound.cs":

datablock AudioEnvironment(Psychotic)
{
   UseRoom = true;
   Room = EAX_ENVIRONMENT_PSYCHOTIC;
   RoomHF = 1;
   Reflections = 0;
   Reverb = 1;
   RoomRolloffFactor = 0.1;
   DecayTime = 0.1;
   DecayHFRatio = 0.1;
   ReflectionsDelay = 0;
   ReverbDelay = 0;
   RoomVolume = 1;
   EffectVolume = 1;
   Damping = 0;
   EnvironmentSize = 10;
   EnvironmentDiffusion = 1;
   AirAbsorption = 0;
   Flags = 0;
};

datablock AudioSampleEnvironment(TestEnv)
{
   Direct = 0.5;
   DirectHF = 1;
   Room = 0.5;
   RoomHF = 1;
   Obstruction = 0.5;
   ObstructionLFRatio = 0.5;
   Occlusion = 1;
   OcclusionLFRatio = 0.5;
   OcclusionRoomRatio = 0.5;
   RoomRolloff = 0;
   AirAbsorption = 0.5;
   OutsideVolumeHF = 0;
   Flags = 0;
};

datablock AudioDescription(PsychoticDesc)
{
  volume             = 1.0;
  isLooping          = false;
  //IsStreaming		= false;
  is3D               = true;
  ReferenceDistance  = 1.0;
  MaxDistance        = 100.0;
  //ConeInsideAngle    = 360;
  //ConeOutsideAngle   = 360;
  //ConeOutsideVolume  = 1.0;
  //ConeVector.set(0, 0, 1);
  EnvironmentLevel   = 1;
  //LoopCount          = 2;
  //MinLoopGap         = 0;
  //MaxLoopGap         = 0;  
  type               = $SimAudioType;
};

datablock AudioProfile(TestSound)
{
   fileName = "~/data/sound/orc_pain.ogg";
   description = PsychoticDesc;
   preload = true;
   environment = "TestEnv";
};

I'm trying to get it to play orc_pain.ogg with the predefined (Defined in line 89 of audioDatablock.cpp) effect called EAX_ENVIRONMENT_PSYCHOTIC, some kind of reverb effect..

Right off the bat I can see quite a major problem, I define the datablock for the AudioEnvironment, but no where does it attach those attributes to the AudioProfile TestSound. TestSound has Environment = TestEnv;
But TestEnv is a AudioSampleEnviroment, which doesn't seem to have reverb in it...

Can someone please set up a basic example sound datablock set, kind of like what I have above (All variables that are possible are there, ones not needed are commented" That way I have a foundation of a sound setup, with all the trimmings.

(Yes this is related to my very recent thread Audio Shaders, I decided not to post this on that thread, in case sourcecode needs to be revealed)

#1
12/04/2006 (1:00 pm)
I suppose it would be possible, with these types of EAX effects to make underwater sound effects, that would make a great resource.