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

Use linear distance model for audio #425

Merged
merged 7 commits into from
Sep 10, 2022
Merged

Conversation

bibendovsky
Copy link
Owner

No description provided.

@bibendovsky bibendovsky added this to the v1.2.12 milestone Aug 26, 2022
@bibendovsky
Copy link
Owner Author

Test builds:
bstone-bin-win32-v1.2.12-wip-fec30e4d0262fb162ed915e35ec93248e2f8495e.zip
bstone-bin-win64-v1.2.12-wip-fec30e4d0262fb162ed915e35ec93248e2f8495e.zip

Linear distance model parameters (see p.3.4.4 of OpenAL 1.1 Specification):
Min distance: 2.0
Max distance 8.0
Rolloff factor: 0.9
The gain outside of max distance: 0.1

@mrmatteastwood
Copy link

Tested this real quick on my laptop with built-in stereo speakers and I get the impression the volume fluctuations have greatly improved. Awesome!

XBRZ still doesn't work though, and the game crashes right after dying (as mentioned in two other bug reports).

I'll be more than happy to test this again on my desktop PC in 7.1 surround on Monday, when I'm back from vacation.

@mrmatteastwood
Copy link

@bibendovsky Checked again on my desktop using 7.1 sound and my home theatre system. I do think the volume fluctuations have dramatically improved, though the digitized (Sound Blaster) SFX still seem softer than some Adlib effects, e.g. when pushing a wall, trying to open a locked door or dying.

Also, it feels a bit like the sounds fade fast over short distances, i.e., they become fairly quiet even when the emitter (an enemy for example) is not far away.

@bibendovsky
Copy link
Owner Author

Test builds:
bstone-bin-win32-v1.2.12-wip-c9c4641b37d23ca42fda58301e7640a1c2e9ffc4.zip
bstone-bin-win64-v1.2.12-wip-c9c4641b37d23ca42fda58301e7640a1c2e9ffc4.zip

Updated attenuation to match the vanilla one.
Note, that since OpenAL does not provide API to alter the mixing it will sound quieter comparing to SDL.

@bibendovsky bibendovsky marked this pull request as ready for review September 10, 2022 10:15
@bibendovsky bibendovsky merged commit 5f069e5 into develop Sep 10, 2022
@bibendovsky bibendovsky deleted the fix/424_sound_attenuation branch September 17, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants