bugfix
This commit is contained in:
parent
1382ecdba5
commit
8db51c5240
@ -12,11 +12,16 @@ class LLMAudioStreamTrack(AudioStreamTrack):
|
||||
|
||||
async def recv(self):
|
||||
print(f'LLMAudioStreamTrack():recv() called ....')
|
||||
try:
|
||||
b = self.get_audio_bytes()
|
||||
if b is None:
|
||||
return b
|
||||
frame = AudioFrame.from_ndarray(io.BytesIO(b), format='s16', layout='mono')
|
||||
return frame
|
||||
except Exception as e:
|
||||
print_exc()
|
||||
print(f'{self.__class__.__name__} recv() exception happened')
|
||||
raise e
|
||||
|
||||
def set_cur_audio_iter(self):
|
||||
if len(self.audio_iters) == 0:
|
||||
|
@ -57,6 +57,7 @@ class MyAudioStreamTrack(AudioStreamTrack):
|
||||
|
||||
async def _recv(self):
|
||||
if self.source is None:
|
||||
print('self._recv() return None')
|
||||
return None
|
||||
f = await self.track.recv()
|
||||
return f
|
||||
|
@ -126,7 +126,8 @@ class RTCLLM:
|
||||
'player':player,
|
||||
'pc':pc
|
||||
})
|
||||
pc.addTrack(MyAudioStreamTrack(player))
|
||||
pc.addTrack(llmtrack)
|
||||
# pc.addTrack(MyAudioStreamTrack(player))
|
||||
pc.addTrack(MyVideoStreamTrack(player))
|
||||
# pc.addTrack(LoopingVideoTrack('./1.mp4'))
|
||||
# pc.addTrack(player.video)
|
||||
|
Loading…
Reference in New Issue
Block a user