Jump to content

EAX Effects in Leadwerks 5 beta


Josh

1,655 views

 Share

I've been doing some work on the sound system in Leadwerks 5 beta, and I added EAX effects in. If you have a dedicated sound card this can be used to add some nice reverb effects that make your sound environment sound a lot more real:

Here's the simplest usage:

auto fx = LoadSoundEffect("Sound/FX/sewerpipe.json");
auto listener = CreateListener(world);
listener->SetEffect(fx);

This will apply the effect to all mono sources. Stereo sources are assumed to be music or GUI noises, and will be unaffected. Eventually, the way I see this being used is a script attached to a CSG brush that changes the listener's EAX effect when the player enters and leaves the volume, but the above shows the API approach.

I exported all the EAX presets into JSON files like so. You can load one of the existing files, or if you are feeling really creative you can try making your own:

{
	"AirAbsorptionGainHF": 0.99426,
	"DecayHFLimit": 0,
	"DecayHFRatio": 0.89,
	"DecayLFRatio": 0.41,
	"DecayTime": 2.76,
	"Density": 1.0,
	"Diffusion": 0.82,
	"EchoDepth": 0.17,
	"EchoTime": 0.13,
	"Gain": 0.316228,
	"GainHF": 0.281838,
	"GainLF": 0.0891251,
	"HFReference": 2854.4,
	"LateReverbGain": 0.891251,
	"LateReverbPan": [0.0, 0.0, 0.0],
	"LFReference": 107.5,
	"LateReverbDelay": 0.02,
	"ModulationDepth": 0.0,
	"ModulationTime": 0.25,
	"ReflectionsDelay": 0.029,
	"ReflectionsGain": 0.354813,
	"ReflectionsPan": [0.0, 0.0, -0.0],
	"RoomRolloffFactor": 0.0
}

Here's the full list of available presets:

  • CastleSmallroom
  • CastleMediumroom
  • CastleLongpassage
  • CastleLargeroom
  • CastleHall
  • CastleCupboard
  • CastleCourtyard
  • CastleAlcove
  • FactoryAlcove
  • FactoryShortPassage
  • FactoryMediumRoom
  • FactoryLongPassage
  • FactoryLargeRoom
  • FactoryHall
  • FactoryCupboard
  • FactoryCourtyard
  • FactorySmallRoom
  • IcepalaceAlcove
  • IcepalaceShortPassage
  • IcepalaceMediumRoom
  • IcepalaceLongPassage
  • IcepalaceLargeroom
  • IcepalaceHall
  • IcepalaceCupboard
  • IcepalaceCourtyard
  • IcepalaceSmallRoom
  • SpacestationAlcove
  • SpacestationMediumRoom
  • SpacestationShortpassage
  • SpacestationLongPassage
  • SpacestationLargeRoom
  • SpacestationHall
  • SpacestationCupboard
  • SpacestationSmallRoom
  • WoodenAlcove
  • WoodenShortPassage
  • WoodenMediumRoom
  • WoodenLongPassage
  • WoodenLargeRoom
  • WoodenHall
  • WoodenCupboard
  • WoodenSmallRoom
  • WoodenCourtyard
  • SportEmptyStadium
  • SportSquashCourt
  • SportSmallSwimmingPool
  • SportLargeSwimmingPool
  • SportGymnasium
  • SportFullStadium
  • SportStadiumTannoy
  • Workshop
  • SchoolRoom
  • PractiseRoom
  • Outhouse
  • Caravan
  • Dome
  • Tomb
  • PipeSmall
  • DomeSaintPauls
  • PipeLongThing
  • PipeLarge
  • PipeResonant
  • OutdoorsBackyard
  • OutdoorsRollingPlains
  • OutdoorsDeepCanyon
  • OutdoorsCreek
  • OutdoorsValley
  • MoodHeaven
  • MoodHell
  • MoodMemory
  • DrivingCommentator
  • DrivingPitGarage
  • DrivingInCarRacer
  • DrivingInCarSports
  • DrivingFullGrandstand
  • DrivingEmptyGrandstand
  • DrivingTunnel
  • CityStreets
  • CitySubway
  • CityMuseum
  • CityLibrary
  • CityUnderpass
  • Dustyroom
  • Chapel
  • SmallWaterRoom

I might consider implementing Steam Audio in the future (formerly Phonon) but for now OpenAL does everything I want.

  • Like 4
 Share

1 Comment


Recommended Comments

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...