mirror of
https://github.com/HumanAIGC/lite-avatar.git
synced 2026-02-05 18:09:20 +08:00
add files
This commit is contained in:
17
funasr_local/runtime/python/grpc/grpc_client.py
Normal file
17
funasr_local/runtime/python/grpc/grpc_client.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import queue
|
||||
import paraformer_pb2
|
||||
|
||||
def transcribe_audio_bytes(stub, chunk, user='zksz', language='zh-CN', speaking = True, isEnd = False):
|
||||
req = paraformer_pb2.Request()
|
||||
if chunk is not None:
|
||||
req.audio_data = chunk
|
||||
req.user = user
|
||||
req.language = language
|
||||
req.speaking = speaking
|
||||
req.isEnd = isEnd
|
||||
my_queue = queue.SimpleQueue()
|
||||
my_queue.put(req)
|
||||
return stub.Recognize(iter(my_queue.get, None))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user