This commit is contained in:
yumoqing 2024-09-14 15:10:04 +08:00
parent bc6e9233dd
commit 0d2b45ca72
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ class MyMediaPlayer(MediaPlayer):
pass pass
class MyTrackBase(MediaStreamTrack): class MyTrackBase(MediaStreamTrack):
def __init__(self, source=None): def __init__(self, source):
super().__init__() super().__init__()
self.dumb = None self.dumb = None
self.source = source self.source = source
@ -47,13 +47,13 @@ class MyTrackBase(MediaStreamTrack):
class MyAudioStreamTrack(MyTrackBase): class MyAudioStreamTrack(MyTrackBase):
kind = 'audio' kind = 'audio'
def __init__(self, source): def __init__(self, source):
super().__init__(source=source) super().__init__(source)
self.dumb = AudioStreamTrack() self.dumb = AudioStreamTrack()
class MyVideoStreamTrack(MyTrackBase): class MyVideoStreamTrack(MyTrackBase):
kind = 'video' kind = 'video'
def __init__(self, source): def __init__(self, source):
super().__init__(source=source) super().__init__(source)
self.dumb = AudioStreamTrack() self.dumb = AudioStreamTrack()
""" """

View File

@ -51,7 +51,6 @@ RTCPeerConnection.get_local_candidates = pc_get_local_candidates
class RTCLLM: class RTCLLM:
def __init__(self, ws_url, iceServers): def __init__(self, ws_url, iceServers):
# self.stt_model = WhisperModel('large-v3', device="cuda", compute_type="float16")
self.ws_url = ws_url self.ws_url = ws_url
self.omni_infer = OmniInference(ckpt_dir='/d/models/mini-omni') self.omni_infer = OmniInference(ckpt_dir='/d/models/mini-omni')
self.iceServers = iceServers self.iceServers = iceServers
@ -132,6 +131,7 @@ class RTCLLM:
# pc.addTrack(LoopingVideoTrack('./1.mp4')) # pc.addTrack(LoopingVideoTrack('./1.mp4'))
# pc.addTrack(player.video) # pc.addTrack(player.video)
await self.ws_send(json.dumps({'type':'callAccepted', 'to':data['from']})) await self.ws_send(json.dumps({'type':'callAccepted', 'to':data['from']}))
print('auto_accept_call() end')
async def pc_track(self, peerid, track): async def pc_track(self, peerid, track):
peer = self.peers[peerid] peer = self.peers[peerid]