This commit is contained in:
yumoqing 2024-09-18 16:13:27 +08:00
parent d53e466f2b
commit 73d12cba4a

View File

@ -142,7 +142,6 @@ class AudioTrackVad(MediaStreamTrack):
super().__init__()
self.track = track
self.vad = MyVad(callback=onvoiceend)
self.vad_check = awaitify(self.vad.vad_check)
# self.sample_rate = self.track.getSettings().sampleRate
# frameSize = self.track.getSettings().frameSize
# self.frame_duration_ms = (1000 * frameSize) / self.sample_rate
@ -171,7 +170,7 @@ class AudioTrackVad(MediaStreamTrack):
try:
frames = to16000_160_frames(frame)
for frame in frames:
await self.vad_check(frame)
await self.vad.vad_check(frame)
except Exception as e:
print(f'{e=}')
print_exc()