mantou132 / nesbox

Online multiplayer games platform
https://nesbox.xianqiao.wang/
MIT License
387 stars 33 forks source link

房间内支持语音 #152

Closed mantou132 closed 2 years ago

mantou132 commented 2 years ago

在玩玩家可以选择加入语音。

mantou132 commented 2 years ago

通过服务端 WebSockets 转发音频,避免影响主机。

https://levelup.gitconnected.com/websockets-in-actix-web-full-tutorial-websockets-actors-f7f9484f5086

mantou132 commented 2 years ago

使用 WebSockets 不能简单获取流数据(MediaRecord),所以需要使用 WebRTC 进行转发

https://github.com/webrtc-rs/examples/tree/main/examples/broadcast

mantou132 commented 2 years ago

以添加初始 webrtc 语音支持:https://github.com/mantou132/nesbox/commit/3a3a2167b52bbb4c6a63a2c462d57cc72f6b20bf

下载仅仅在本地测试,暂不清楚是否有 rtc 连接泄露、cpu 占用、可靠性等问题。

Firefox 问题:

bug