mirror of
https://github.com/shirayu/whispering.git
synced 2024-11-25 10:21:00 +00:00
Fix
This commit is contained in:
parent
936d5d0c45
commit
847eee5819
1 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ async def serve_with_websocket_main(websocket):
|
||||||
)
|
)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
logger.debug(f"Segment #: {idx}")
|
logger.debug(f"Audio #: {idx}")
|
||||||
try:
|
try:
|
||||||
message = await websocket.recv()
|
message = await websocket.recv()
|
||||||
except ConnectionClosedOK:
|
except ConnectionClosedOK:
|
||||||
|
@ -32,9 +32,9 @@ async def serve_with_websocket_main(websocket):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.debug(f"Message size: {len(message)}")
|
logger.debug(f"Message size: {len(message)}")
|
||||||
segment = np.frombuffer(message, dtype=np.float32)
|
audio = np.frombuffer(message, dtype=np.float32)
|
||||||
for chunk in g_wsp.transcribe(
|
for chunk in g_wsp.transcribe(
|
||||||
segment=segment, # type: ignore
|
audio=audio, # type: ignore
|
||||||
ctx=ctx,
|
ctx=ctx,
|
||||||
):
|
):
|
||||||
await websocket.send(chunk.json())
|
await websocket.send(chunk.json())
|
||||||
|
|
Loading…
Reference in a new issue