add offline websocket server/client (#98)

This commit is contained in:
Fangjun Kuang
2023-03-29 21:48:45 +08:00
committed by GitHub
parent 5e5620ea23
commit 6707ec4124
15 changed files with 1032 additions and 59 deletions

View File

@@ -24,13 +24,12 @@ https://github.com/k2-fsa/sherpa-onnx/blob/master/sherpa-onnx/csrc/online-websoc
import argparse
import asyncio
import sys
import time
import numpy as np
try:
import sounddevice as sd
except ImportError as e:
except ImportError:
print("Please install sounddevice first. You can use")
print()
print(" pip install sounddevice")
@@ -134,7 +133,7 @@ async def run(
await websocket.send(indata.tobytes())
decoding_results = await receive_task
print("\nFinal result is:\n{decoding_results}")
print(f"\nFinal result is:\n{decoding_results}")
async def main():