Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environmental Suit Sound effect doesn't work. #598

Open
FriskTheFallenHuman opened this issue Aug 3, 2024 · 1 comment
Open

Environmental Suit Sound effect doesn't work. #598

FriskTheFallenHuman opened this issue Aug 3, 2024 · 1 comment

Comments

@FriskTheFallenHuman
Copy link

Currently the engine's sound system doesn't include the Environmental Suit here, it seems like EnviroSuit sound effect wasn't ported to OpenAl-soft

@DanielGibson
Copy link
Member

DanielGibson commented Jan 21, 2025

Are you sure about this?
Yes, that function isn't called anymore, but enviroSuitActive is used elsewhere to set an EFX filter:

dhewm3/neo/sound/snd_world.cpp

Lines 1869 to 1877 in 0110a62

if (idSoundSystemLocal::useEFXReverb) {
if (enviroSuitActive) {
alSourcei(chan->openalSource, AL_DIRECT_FILTER, listenerFilters[0]);
alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, listenerFilters[1]);
} else {
alSourcei(chan->openalSource, AL_DIRECT_FILTER, AL_FILTER_NULL);
alSource3i(chan->openalSource, AL_AUXILIARY_SEND_FILTER, listenerSlot, 0, AL_FILTER_NULL);
}
}

listenerFilters[0] and listenerFilters[1] should apply lowpass filters:

soundSystemLocal.alGenFilters(2, listenerFilters);
ALuint e = alGetError();
if (e != AL_NO_ERROR) {
common->Warning("idSoundWorldLocal::Init: alGenFilters failed: 0x%x", e);
listenerFilters[0] = AL_FILTER_NULL;
listenerFilters[1] = AL_FILTER_NULL;
} else {
soundSystemLocal.alFilteri(listenerFilters[0], AL_FILTER_TYPE, AL_FILTER_LOWPASS);
// original EAX occusion value was -1150
// default OCCLUSIONLFRATIO is 0.25
// default OCCLUSIONDIRECTRATIO is 1.0
// pow(10.0, (-1150*0.25*1.0)/2000.0)
soundSystemLocal.alFilterf(listenerFilters[0], AL_LOWPASS_GAIN, 0.718208f);
// pow(10.0, (-1150*1.0)/2000.0)
soundSystemLocal.alFilterf(listenerFilters[0], AL_LOWPASS_GAINHF, 0.266073f);
soundSystemLocal.alFilteri(listenerFilters[1], AL_FILTER_TYPE, AL_FILTER_LOWPASS);
// original EAX occusion value was -1150
// default OCCLUSIONLFRATIO is 0.25
// default OCCLUSIONROOMRATIO is 1.5
// pow(10.0, (-1150*(0.25+1.5-1.0))/2000.0)
soundSystemLocal.alFilterf(listenerFilters[1], AL_LOWPASS_GAIN, 0.370467f);
// pow(10.0, (-1150*1.5)/2000.0)
soundSystemLocal.alFilterf(listenerFilters[1], AL_LOWPASS_GAINHF, 0.137246f);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants