Audio (3D?)

If it bleeps, it goes here
mfep
Posts: 3
Joined: Thu Jun 12, 2025 2:51 pm
Contact:

Re: Audio (3D?)

Post by mfep »

OK, I managed to put in some effort this week, and am happy to share some results.
  • The audio backend has been abstracted away, so we can now support multiple backends, and switch between them at runtime.
  • The original audio system has been refactored into the so called SDL backend.
  • And a new backend has been added named OpenAL backend.
  • The menu has been modified has been added to switch between the two, with the option of enable binaural rendering in the OpenAL backend's case.
Notably, I didn't change how the rest of the game systems interact with the audio system, nor any of the audio files. Still, I have the impression that the result is a major improvement over the current (SDL) backend. The number of concurrently playing sources is greatly improved, and the very noticable clicking when stealing voices in the original audio system is gone. Moreover, the very ugly hard clipping of loud signals is also fixed using OpenAL. Also, the other effects I mentioned above should also be present. I had to tune down the Doppler effect a bit: using the real-world speed of sound sounded a bit too much. This can be refined later, or even be controlled by other in-game systems.

To illustrate the results, here is a short gameplay recording in which I switch multiple times between the two backends to compare the two: https://youtu.be/Pp1bdDPJvio

For now, this works on Linux only. I will have to make sure that Windows is also supported, and that OpenAL Soft is properly integrated to the build pipeline.
Post Reply