-
Notifications
You must be signed in to change notification settings - Fork 14
feat: spatial audio stream & video player #6162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Windows and Mac build successful in Unity Cloud! You can find a link to the downloadable artifact below. |
NickKhalow
left a comment
There was a problem hiding this 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
Explorer/Assets/DCL/SDKComponents/MediaStream/MultiMediaPlayer.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/SDKComponents/MediaStream/MultiMediaPlayer.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # Explorer/Assets/DCL/SDKComponents/MediaStream/Components/MediaPlayerComponent.cs
Explorer/Assets/DCL/SDKComponents/MediaStream/Systems/CreateMediaPlayerSystem.cs
Show resolved
Hide resolved
Explorer/Assets/DCL/SDKComponents/MediaStream/Systems/UpdateMediaPlayerSystem.cs
Outdated
Show resolved
Hide resolved
davidejensen
left a comment
There was a problem hiding this 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
# Conflicts: # Explorer/Assets/Protocol/DecentralandProtocol/AvatarLocomotionSettings.gen.cs.meta # scripts/package-lock.json # scripts/package.json
Ludmilafantaniella
left a comment
There was a problem hiding this 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
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
PBAudioStreamandPBVideoPlayer.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: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
Code Review Reference
Please review our Code Review Standards before submitting.