Skip to content

Architecture

stechyo edited this page May 20, 2024 · 3 revisions

Architecture demo.

The most crucial methods in the extension are SteamAudioServer::tick() and SteamAudioStreamPlayback::_mix(). The tick method is responsible for updating all audio simulation state, going through the given listener and all audio sources, taking into account the SteamAudio scene that has been created by the given set of SteamAudioGeometry nodes, and updating a set of simulation outputs in each SteamAudioPlayer local state. This local state is used in _mix, in which the stream playback gets its inner stream (that is, the stream that you configured the audio player to have), and consults its player's local state in order to apply a set of effects to it, returning the resulting audio which is then played by Godot's AudioServer. If you want to contribute, keep in mind that things run in different threads, and you cannot be sure at which order things are deleted on queue_free() or program exit. Particularly, playbacks run on the audio thread, tick and SteamAudioPlayers run on the scene thread, and SteamAudioServer has its own thread to simulate reflections as recommended by Valve.

Clone this wiki locally