Skip to content

Play audio sources without a position unspatialized, so stereo clips keep their channels - #729

Merged
stanoddly merged 1 commit into
mainfrom
unspatialized-audio-sources
Nov 19, 2026
Merged

stanoddly merged 1 commit into
mainfrom
unspatialized-audio-sources

Conversation

@botoddly

Copy link
Copy Markdown
Collaborator

Fixes #728

  • AudioSource.Position is now a Vector3? that defaults to null. Null passes NULL to MIX_SetTrack3DPosition, so SDL_mixer plays the clip unspatialized, with its own channels. Any position, Vector3.Zero included, spatializes the track and mixes it down to mono.
  • Moving AudioListener.Position re-applies only the sources that have a position.
  • New tests in AudioSystemTests read the track position back from SDL_mixer. A source without a position stays at the origin while the listener moves, and setting a position and then null reaches the track. Pixely.Audio exposes internals to Pixely.Tests for this.

The y-only position change that SDL_mixer 3.2.4 ignores is tracked in stanoddly/XDL#36.

@stanoddly
stanoddly enabled auto-merge (squash) November 19, 2026 13:16
@stanoddly
stanoddly merged commit c72b838 into main Nov 19, 2026
3 checks passed
@stanoddly
stanoddly deleted the unspatialized-audio-sources branch November 19, 2026 13:19
@github-actions

Copy link
Copy Markdown

📦 Development package Pixely 0.0.176 is available.

Workflow run (attempt 1)

@github-actions

Copy link
Copy Markdown

✅ Development package validation passed on all platforms.

Workflow run (attempt 1)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AudioSource always spatializes, so stereo clips play in mono

2 participants