Skip to content

Play the proximity beacon on iOS as the destination gets close - #1069

Merged
davecraig merged 1 commit into
Scottish-Tech-Army:mainfrom
davecraig:main
Sep 8, 2026
Merged

Play the proximity beacon on iOS as the destination gets close#1069
davecraig merged 1 commit into
Scottish-Tech-Army:mainfrom
davecraig:main

Conversation

@davecraig

Copy link
Copy Markdown
Contributor

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

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
davecraig merged commit b73cf9d into Scottish-Tech-Army:main Sep 8, 2026
4 checks passed
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.

1 participant