question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App: WSRTC integration

See original GitHub issue

We have wsrtc as a WS-backed backend implementation. app can start to connect to it.

Most of that implementation is in world.js, which is currently backed by xrrtc, but those servers are not up and we should move to thew new API.

  • connect/disconnect from the room
  • send pose data
  • send audio
  • receive pose data
  • receive audio

Local pose send

Local poses for the rig are grabbed and sent on the wire here: https://github.com/webaverse/app/blob/aeb45b6c3136bce4dfb1a64d06b420bf0f74a4b6/world.js#L133

This can already be done with pose is wsrtc, which has position/quaternion/scale tracking, but in app there is additional pose data for avatar states like animations, crouch, etc, and something called aux, which is all of the stuff attached to your avatar like wearables and pets. That can already be hooked up to use the wsrtc per-user metadata mechanism, but soon we’ll want to serialize this all to binary and transfer it as such in wsrtc, which depends on https://github.com/webaverse/wsrtc/issues/2.

Remote pose receive

Remote poses are received here: https://github.com/webaverse/app/blob/aeb45b6c3136bce4dfb1a64d06b420bf0f74a4b6/world.js#L212

This should be ported to get the pose from wsrtc.

Audio

We previously had a track-based low level audio solution, but now wsrtc gives us the audio context and the raw audio nodes which we can hook up in the graph to do positional audio for player.

Also note that wsrtc computes the volume levels, which are used for mouth flaps. That needs to also be plugged in: https://github.com/webaverse/app/blob/65db2efa3e89b695bb626f7f2cbcd4a078bf9dab/rig.js#L352

World

We can leave this to last, but wsrtc has a new Entity system which can replace the current “tracked objects”, and runtime can be moved to more of a component system responding to the Entity state.

This is still all based on y.js but I don’t think the app code will need to be aware of that anymore if it is using the wsrtc Entity abstraction.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
AGoblinKingcommented, Aug 27, 2021

https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker

A USVString representing the URL of the script the worker will execute. It must obey the same-origin policy.

ugh, that foils part of that plan.

1reaction
avaercommented, Aug 26, 2021

There should be 1024b (1k) of extra data available for player poses now: https://github.com/webaverse/wsrtc/blob/198e1920c9f4b96d9a3ab1b11a64eaa466682847/wsrtc.js#L17

Any typed array is accepted as extra here, though we will need a serialization protocol for more complex data.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrating WebRTC with your app - YouTube
Integrating WebRTC elements into your existing application. How we did it, what did we learn and what we're thinking for the future.
Read more >
WSRTC Projects
Operations Incubator: Regional Integrated Corridor Management Planning. This work moved toward establishing criteria and processes for applying ICM to a rural ...
Read more >
webaverse/wsrtc: Websocket based multiplayer. - GitHub
wsrtc. WebSocket based state and media stream transport SFU. client. Uses apis like WebCodecs (or WebCodecs polyfill) to generate synchronized state. server.
Read more >
Western States Rural Transportation Consortium (WSRTC ...
Consortium (WSRTC) Transportation. A collaborative mechanism to leverage research activities in a coordinated manner to respond to rural transportation ...
Read more >
Focus Area: Systems Engineering Development & Integration
WSRTC Meeting Coordination, Western States Forum Travel Support and Website ... website or on WTI's Integration of Aviation AWOS with RWIS project webpage....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found