Play the proximity beacon on iOS as the destination gets close - #1069
Merged
Conversation
The iOS engine only ever created the directional beacon. Android's BeaconWithProximity, and the original iOS app's ProximityBeacon, also run a second beacon alongside it whose asset is chosen by distance: Proximity_Close inside proximityNear, Proximity_Far out to twice that, silence beyond. So IosAudioEngine took a proximityNear argument in updateGeometry and threw it away, and ignored headingOnly in createBeacon. Selectors now take a BeaconGeometry (heading, bearing, distance, proximityNear) rather than heading and bearing alone, which is what lets a selector be driven by distance instead of angle. The proximity beacon is not spatialised - it is about distance, not direction - so it connects straight to mainMixerNode. That is required rather than merely tidier: the bundled Proximity_*.wav files are stereo, and AVAudioEnvironmentNode only accepts mono. The WAVs are already in the iOS bundle via the Sounds folder reference in project.yml. Not compile-checked: iOS targets are gated to macOS in shared/build.gradle.kts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DQyoTtPL9ENAf6PiJKmhXf
davecraig
temporarily deployed
to
development
September 8, 2026 10:53 — with
GitHub Actions
Inactive
davecraig
temporarily deployed
to
development
September 8, 2026 10:53 — with
GitHub Actions
Inactive
davecraig
temporarily deployed
to
development
September 8, 2026 10:53 — with
GitHub Actions
Inactive
davecraig
temporarily deployed
to
development
September 8, 2026 10:53 — with
GitHub Actions
Inactive
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.
The iOS engine only ever created the directional beacon. Android's BeaconWithProximity, and the original iOS app's ProximityBeacon, also run a second beacon alongside it whose asset is chosen by distance: Proximity_Close inside proximityNear, Proximity_Far out to twice that, silence beyond. So IosAudioEngine took a proximityNear argument in updateGeometry and threw it away, and ignored headingOnly in createBeacon.
Selectors now take a BeaconGeometry (heading, bearing, distance, proximityNear) rather than heading and bearing alone, which is what lets a selector be driven by distance instead of angle. The proximity beacon is not spatialised - it is about distance, not direction - so it connects straight to mainMixerNode. That is required rather than merely tidier: the bundled Proximity_*.wav files are stereo, and AVAudioEnvironmentNode only accepts mono.
The WAVs are already in the iOS bundle via the Sounds folder reference in project.yml. Not compile-checked: iOS targets are gated to macOS in shared/build.gradle.kts.
Claude-Session: https://claude.ai/code/session_01DQyoTtPL9ENAf6PiJKmhXf