feat(sim): spatialize world audio - #754
Conversation
Greptile SummaryThe PR spatializes simulator audio using the active camera and current robot or prop positions, while preserving full volume in robot-camera views.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Sequence DiagramsequenceDiagram
participant Viewer as Simulator viewer
participant Spatial as Spatial audio state
participant ROS as ROS audio topics
participant Player as Browser audio player
Viewer->>Spatial: Publish active view, listener, and source positions
ROS->>Player: Deliver motor PCM or TTS clip with source
Player->>Spatial: Follow source when playback begins
Spatial-->>Player: Apply current distance-based gain
Viewer->>Spatial: Clear perspective on detach or destroy
Spatial-->>Player: Restore full-volume default
Reviews (2): Last reviewed commit: "fix(sim): clear spatial audio on stage t..." | Re-trigger Greptile |
567fbfd to
da17d5f
Compare
d0f9b12 to
950cd0b
Compare
|
Rewrote this branch as a single commit on top of current
Size: the PR is now 13 files, +165 −40 (was 28 files, +754 −60). Verified: ruff clean, |
The viewer dispatches a perspective snapshot (active view, listener, robot and prop positions) after every primary render. In the third-person orbit view, motor sound and speech fade with camera distance; robot-camera views stay at full loudness. /tts/audio in sim now always carries a JSON clip with the simulated body it comes from, so a household resident's line plays from their prop.
950cd0b to
c7abb0e
Compare
Summary
Validation
node --test webapp/tests/*.test.jsnpm run typecheck && npm run build:libinsim/viewerpytest -q tests/test_challenge_runtime.py tests/test_household_npc.py(19 passed)pytest -q ros2_ws/src/brain/brain_client/test/test_tts.py(8 passed)git diff --checkresident_alex; orbit-distance falloff and first-person restoration were exercised; no audio playback errors appeared in browser diagnosticsStacked on #750 because it owns the simulator motor-audio stream and PCM player. The stack includes #750's latest follow-up commit and is based on current
main.