Skip to content

Sfx system refactor#1730

Open
marauder2k7 wants to merge 7 commits into
TorqueGameEngines:developmentfrom
marauder2k9-torque:SFXSystem-Refactor
Open

Sfx system refactor#1730
marauder2k7 wants to merge 7 commits into
TorqueGameEngines:developmentfrom
marauder2k9-torque:SFXSystem-Refactor

Conversation

@marauder2k7
Copy link
Copy Markdown
Contributor

@marauder2k7 marauder2k7 commented May 7, 2026

Added a system similar to graphics devices for loading sfx devices and creates a provider for each device.
Fixed options menu syncing device names and changing devices.

Added reverb, speed of sound, doppler effect controls to amience so soundscapes can switch out these settings
audio.tscript functions such as sfxinit are no longer required.

These changes give the best chance for an sfx device to be ready for loading soundassets, some may still load before a device is ready until soundasset is triggered from the sfx system.

Interface additions to SFX:
SFXSampleType to better match at the device level for buffer creation and stream protection
HRTF base implementation for openal (needs proper interface)

REQUIRES TEMPLATE REINSTALL FOR SCRIPTS!

DSound has since been deprecated and xaudio2 would require us to write our own 3d spatialization and mixer
Load devices the same way we load in the gfx end
setup sfx provider
run sfx devices on startup
various fixes around sfx null device
added the bitrate and samplerate globals
added the hrtf global code is in to use this but not setup yet
Adds speed of sound to the sound system
SFXAmbience now has a property for speed of sound for different mediums, can also be set directly
Adds reverb functionality to sound system

TODO: Make a proper sfxMixer api that will route voices to channels that have the effects slots added to them. this is just a place holder for a more complete implementation
more info for the device is printed out, along with hrtf detection
fix levelinfo sending the distance model
working example of hrtf set the pref usehrtf to true to test
For now any mhr file that is in the game directory can be used, just run once to get the index of that mhr and pass that index in to $pref::SFX::hrtfProfile
Adds the resolved track stuff from the soundAsset refactor
also uses the refresh asset so changes do not cause a sound to stop working
@marauder2k7 marauder2k7 force-pushed the SFXSystem-Refactor branch from ba91e24 to 823054e Compare May 11, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant