From c56e103044bb3055307fbccdd9a4b877fd14b971 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 3 Sep 2024 18:09:40 +0800 Subject: [PATCH] bugfix --- rtcllm/rtc.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rtcllm/rtc.py b/rtcllm/rtc.py index 51e57a2..f6a5424 100644 --- a/rtcllm/rtc.py +++ b/rtcllm/rtc.py @@ -68,6 +68,13 @@ class RTCLLM: "type":"candidate", "candidate":candidate, })) + async def send_candidate(self, to, candidate): + print(f'send_candidate():{candidate=}') + await self.ws_send(json.dumps({ + 'type':'candidate', + 'to':to, + 'candidate':candidate + })) async def save_onlineList(self, data): print(f'{self}, {type(self)}') @@ -162,6 +169,10 @@ class RTCLLM: 'answer':{'type':pc.localDescription.type, 'sdp':pc.localDescription.sdp}, 'to':data['from'] })) + cands = await pc.gather__candidates() + for c in cands: + await self.send_candidate(data['from'], c) + """ offer = await pc.createOffer() await pc.setLocalDescription(offer)