Skip to content

Conversation

@lorux0
Copy link
Collaborator

@lorux0 lorux0 commented Nov 12, 2025

What does this PR change?

Fixes #6132

Protocol: decentraland/protocol#322
SDK: decentraland/js-sdk-toolchain#1243

Implements the possibility to set the audio as 3d on PBAudioStream and PBVideoPlayer.

IMPORTANT: There are limitations on the current AV Pro integration. Many formats and codecs are not supported and will not find the audio channel. It fallbacks to System Direct bypassing any unity configuration, meaning the AudioSource. According to documentation and some investigation, although needs confirmation:

Screenshot 2025-11-18 at 14 40 35

Test Instructions

Run this scene: spatial-stream.zip
You will see a plane that outputs an audio as m4a. If you run to the cube, at the back, there is an audio stream going on. Both should be affected by spatial audio. You will hear it louder when you are close, but the more away you are, the volume will be lower. Additionally you can interact with the cube to change the spatial distance.

Quality Checklist

  • Changes have been tested locally
  • Documentation has been updated (if required)
  • Performance impact has been considered
  • For SDK features: Test scene is included

Code Review Reference

Please review our Code Review Standards before submitting.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2025

Copy link
Contributor

@NickKhalow NickKhalow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Please address the comments

@lorux0 lorux0 requested a review from NickKhalow November 18, 2025 19:26
@lorux0 lorux0 added the clean-build Used to trigger clean build on PR label Nov 19, 2025
Copy link
Member

@davidejensen davidejensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Approved with 2 small questions and a very tiny suggestion that could also be easily ignored

@lorux0 lorux0 enabled auto-merge (squash) November 25, 2025 18:38
@lorux0 lorux0 added clean-build Used to trigger clean build on PR and removed clean-build Used to trigger clean build on PR labels Nov 25, 2025
# Conflicts:
#	Explorer/Assets/Protocol/DecentralandProtocol/AvatarLocomotionSettings.gen.cs.meta
#	scripts/package-lock.json
#	scripts/package.json
Copy link
Contributor

@Ludmilafantaniella Ludmilafantaniella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved ✔️

Tested on Windows and Mac following the instructions provided in the PR running the spatial-stream scene.

What I verified

  • Spatial audio works on both PBAudioStream and PBVideoPlayer.
  • Volume increases when approaching the audio source and decreases with distance as expected.
  • Interaction with the cube to change distance settings works correctly.
  • Regression check: global audio continues to behave as before when spatial audio is disabled.

🎧 Notes on the camera/audio-listener behavior

I documented in the thread that the audio listener being tied to the camera (Unity default) can create UX issues in some situations (e.g., avatar facing a screen but the camera positioned behind them → lower volume even though the user is “watching” the source).
After further testing, first-person view works correctly, and the current behavior is consistent with Unity’s spatial audio system.

Given the constraints and the plan to assess UX once this is used in real scenarios, I’m fine with moving forward.

6162-evi.mp4
cameraPos.mp4

✅Regressions performed:

  • ✔️ Backpack and wearables in world
  • ✔️ Emotes with sfx in world
  • ✔️ Teleport with map/coordinates/Jump In
    • MF25
    • Casa Roustan
    • FashionWeek scene
  • ✔️ Settings

@lorux0 lorux0 dismissed NickKhalow’s stale review November 27, 2025 12:35

comments resolved

@lorux0 lorux0 merged commit af947e9 into dev Nov 27, 2025
6 of 7 checks passed
@lorux0 lorux0 deleted the feat/stream-spatial-audio branch November 27, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean-build Used to trigger clean build on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audio Streams that are non-global

6 participants