bugfix
This commit is contained in:
parent
54c9b4c14f
commit
2d7705a8cf
@ -1,4 +1,5 @@
|
||||
import base64
|
||||
from inspect import isfunction, iscoroutinefunction
|
||||
from traceback import print_exc
|
||||
import asyncio
|
||||
import collections
|
||||
@ -124,7 +125,10 @@ class MyVad(webrtcvad.Vad):
|
||||
if duration > 500:
|
||||
ret = frames_write_wave(self.voiced_frames)
|
||||
if self.onvoiceend:
|
||||
self.onvoiceend(ret)
|
||||
if iscoroutinefunction(self.onvoiceend):
|
||||
await self.onvoiceend(ret)
|
||||
else:
|
||||
self.onvoiceend(ret)
|
||||
else:
|
||||
print('-----short voice------')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user