mirror of
https://github.com/shirayu/whispering.git
synced 2024-11-29 04:21:07 +00:00
Changed protocol
This commit is contained in:
parent
e9534ec977
commit
1801a6b7e4
1 changed files with 3 additions and 2 deletions
|
@ -26,8 +26,9 @@ async def serve_with_websocket_main(websocket):
|
|||
|
||||
logger.debug(f"Message size: {len(message)}")
|
||||
segment = np.frombuffer(message, dtype=np.float32)
|
||||
chunks = [chunk.dict() for chunk in g_wsp.transcribe(segment=segment)]
|
||||
await websocket.send(json.dumps(chunks))
|
||||
for chunk in g_wsp.transcribe(segment=segment):
|
||||
await websocket.send(chunk.json())
|
||||
await websocket.send("")
|
||||
idx += 1
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue