From 2bd82419482b9a074c8c464d5b65f997632964d3 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 18 九月 2023 10:44:25 +0800
Subject: [PATCH] Merge branch 'main' of github.com:alibaba-damo-academy/FunASR add
---
funasr/runtime/python/websocket/README.md | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/funasr/runtime/python/websocket/README.md b/funasr/runtime/python/websocket/README.md
index 686ad86..f318fd9 100644
--- a/funasr/runtime/python/websocket/README.md
+++ b/funasr/runtime/python/websocket/README.md
@@ -107,6 +107,20 @@
# --chunk_size, "5,10,5"=600ms, "8,8,4"=480ms
python funasr_wss_client.py --host "0.0.0.0" --port 10095 --mode 2pass --chunk_size "8,8,4" --audio_in "./data/wav.scp" --output_dir "./results"
```
+
+#### Websocket api
+```shell
+ # class Funasr_websocket_recognizer example with 3 step
+ # 1.create an recognizer
+ rcg=Funasr_websocket_recognizer(host="127.0.0.1",port="30035",is_ssl=True,mode="2pass")
+ # 2.send pcm data to asr engine and get asr result
+ text=rcg.feed_chunk(data)
+ print("text",text)
+ # 3.get last result, set timeout=3
+ text=rcg.close(timeout=3)
+ print("text",text)
+```
+
## Acknowledge
1. This project is maintained by [FunASR community](https://github.com/alibaba-damo-academy/FunASR).
2. We acknowledge [zhaoming](https://github.com/zhaomingwork/FunASR/tree/fix_bug_for_python_websocket) for contributing the websocket service.
--
Gitblit v1.9.1