From 5b958b09a1df8703525d2da8fcdd98d47da9789f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 13 Sep 2024 11:10:41 +0800 Subject: [PATCH] bugfix --- rtcllm/vad.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rtcllm/vad.py b/rtcllm/vad.py index 77c2ea0..e6a460a 100644 --- a/rtcllm/vad.py +++ b/rtcllm/vad.py @@ -41,9 +41,7 @@ class AudioTrackVad(MediaStreamTrack): self.running = False def frame2bytes(self, frame): - # 假设你有一个 AudioFrame 对象 audio_frame audio_array = frame.to_ndarray() - # 将 numpy 数组转换为字节数组 dtype = audio_array.dtype audio_bytes = audio_array.tobytes() return audio_bytes @@ -52,7 +50,7 @@ class AudioTrackVad(MediaStreamTrack): oldf = await self.track.recv() self.sample_rate = oldf.sample_rate duration = (oldf.samples * 1000) / oldf.sample_rate - print(f'{duration=}, {oldf.samples=}, (oldf.sample_rate=}') + print(f'{self.__class__.__name__}.recv(): {duration=}, {oldf.samples=}, (oldf.sample_rate=}') frames = self.resample(oldf) for f in frames: if self.debug: