Skip to content

Conversation

@ACrazyTown
Copy link
Contributor

@ACrazyTown ACrazyTown commented Nov 29, 2025

OpenAL Soft will automatically enable HRTF if it detects that headphones are being used.

Specifically, ALSoft tries to figure out if you are using a headphone and then turns on the HRTF. Not all backends support headphone detection and they can still be wrong.
https://github.com/kcat/openal-soft/wiki/User%27s-Guide#hrtf

However, this may not be ideal as HRTF can cause audio to sound "muddy" and lower quality. Considering that in a recent change HRTF was disabled by default on HTML5, I think it would make sense to also disable it on native targets. The AL_SOFT_direct_channels and AL_SOFT_direct_channels_remix extensions are used to disable HRTF per source rather than globally (see: kcat/openal-soft#357 (comment)).

I'm unsure if this change is required (or possible) with Apple's OpenAL implementation. As for MojoAL, it seems to not support HRTF at all.

Since OpenAL Soft's headphone detection seems to be hit or miss, it's easier to test this PR by manually forcing HRTF to be on using OpenAL's config. In the directory with the executable, create a file called alsoft.ini on Windows, or alsoft.conf elsewhere. In it add:

[general]
hrtf=true

Without this patch, any played audio will sound less clean compared to the original audio file, while with the patch it should sound identical to the original file.

LeonGamerPS1 added a commit to Graveyard-Forks/terriblelime that referenced this pull request Dec 1, 2025
@joshtynjala joshtynjala changed the base branch from develop to 8.4.0-dev December 1, 2025 17:06
@joshtynjala joshtynjala changed the base branch from 8.4.0-dev to develop December 1, 2025 17:07
@joshtynjala joshtynjala changed the base branch from develop to 8.4.0-dev December 1, 2025 17:07
@joshtynjala joshtynjala changed the base branch from 8.4.0-dev to develop December 1, 2025 17:08
@joshtynjala joshtynjala changed the base branch from develop to 8.4.0-dev December 1, 2025 17:08
@joshtynjala joshtynjala merged commit 9f43e55 into openfl:8.4.0-dev Dec 1, 2025
31 checks passed
@joshtynjala
Copy link
Member

Thanks!

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.

2 participants