Repository navigation
Conversation
…polyphony control and voice stopping
jonjondev
force-pushed
the
feature/audio
branch
from
November 8, 2026 22:44
b5dc131 to
33ae3a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a new module to the engine for audio, providing an audio system that can be included by other library or executable targets to manage sound playback. The change also introduces the
miniaudiolibrary dependency, functioning as a backend for the decoding playback functionality which is entirely abstracted away from the interface to avoid bleeding the dependency to dependent code. The following features are currently supported by the system:The system functions by exposing the ability to create and register sound players that can contain and update configuration and the appropriate clip data (which uses raw data from pack files) to the audio system as so:
The system can then attempt to assign the requested sound player out to a free voice to run playback of the sound. If the sound is above its max polyphony threshold or a free voice is not found, it will ignore the request. The sound player can also be updated each frame by its owner to modify its spatialisation in which its location must be set. Because the audio work is kicked over to the audio thread for processing, the system must take care to handle callbacks and requests moving between the game and audio. The system otherwise functions similarly to other engine modules with lifetime hooks for use as part of the game loop.
The system's usage has been added to the examples with test data. Opening the game example, the user can now press the
ckey to playclick.wav(spatialised), thefkey to playcall_to_adventure.mp3(looping), and thegkey to stopcall_to_adventure.mp3. Changing scenes will also clear any playing audio for the entities.The PR has been...
The code has been...
master(according to GitHub)packagetargets