From cc2c1d1d53dea5d2c45f858d1baa5bd279f47987 Mon Sep 17 00:00:00 2001
From: nichongjia-2007 <nichongjia@gmail.com>
Date: 星期三, 31 五月 2023 14:39:25 +0800
Subject: [PATCH] Merge branch 'main' of https://github.com/alibaba-damo-academy/FunASR
---
funasr/runtime/html5/readme_cn.md | 135 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 135 insertions(+), 0 deletions(-)
diff --git a/funasr/runtime/html5/readme_cn.md b/funasr/runtime/html5/readme_cn.md
new file mode 100644
index 0000000..73bf1b0
--- /dev/null
+++ b/funasr/runtime/html5/readme_cn.md
@@ -0,0 +1,135 @@
+# Html5 server for asr service
+
+## Requirement
+#### Install the modelscope and funasr
+```shell
+pip install -U modelscope funasr
+# For the users in China, you could install with the command:
+# pip install -U modelscope funasr -i https://mirror.sjtu.edu.cn/pypi/web/simple
+git clone https://github.com/alibaba/FunASR.git && cd FunASR
+```
+#### Install the requirements for server
+```shell
+pip install flask
+# pip install gevent (Optional)
+# pip install pyOpenSSL (Optional)
+```
+
+### javascript (Optional)
+[html5褰曢煶](https://github.com/xiangyuecn/Recorder)
+```shell
+Recorder
+```
+
+## demo椤甸潰濡備笅
+<div align="center"><img src="./demo.gif" width="150"/> </div>
+
+[//]: # (## 涓ょws_server杩炴帴妯″紡)
+
+[//]: # (### 1)鐩存帴杩炴帴妯″紡锛屾祻瑙堝櫒https楹﹀厠椋� --> html5 demo鏈嶅姟 --> js wss鎺ュ彛 --> wss asr online srv(璇佷功鐢熸垚璇峰線鍚庣湅))
+
+[//]: # (### 2)nginx涓浆锛屾祻瑙堝櫒https楹﹀厠椋� --> html5 demo鏈嶅姟 --> js wss鎺ュ彛 --> nginx鏈嶅姟 --> ws asr online srv)
+
+## 鎿嶄綔姝ラ
+### html5 demo鏈嶅姟鍚姩
+鍚姩html5鏈嶅姟锛岄渶瑕乻sl璇佷功(宸茬敓鎴愶紝濡傞渶瑕佽嚜宸辩敓鎴愯寰�鍚庣湅)
+```shell
+h5Server.py [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] [--keyfile KEYFILE]
+```
+渚嬪瓙濡備笅锛岄渶瑕佹敞鎰廼p鍦板潃锛屽鏋滀粠鍏朵粬璁惧璁块棶闇�姹傦紙渚嬪鎵嬫満绔級锛岄渶瑕佸皢ip鍦板潃璁句负鐪熷疄ip
+```shell
+cd funasr/runtime/html5
+python h5Server.py --host 0.0.0.0 --port 1337
+# python h5Server.py --host 30.220.136.139 --port 1337
+```
+### 鍚姩ASR鏈嶅姟
+[鍏蜂綋璇风湅online asr](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/websocket)
+
+`Tips:` asr 鏈嶅姟闇�瑕佷笌html5鏈嶅姟閮ㄧ讲鍒板悓涓�涓墿鐞嗘満鍣ㄤ笂
+#### wss鏂瑰紡
+```shell
+cd ../python/websocket
+python wss_srv_asr.py --port 1095
+```
+
+### 娴忚鍣ㄦ墦寮�鍦板潃
+ip鍦板潃闇�瑕佷笌html5 server淇濇寔涓�鑷达紝濡傛灉鏄湰鍦版満鍣紝鍙互鐢�127.0.0.1
+```shell
+https://127.0.0.1:1337/static/index.html
+# https://30.220.136.139:1337/static/index.html
+```
+
+### 淇敼缃戦〉閲宎sr鎺ュ彛鍦板潃
+淇敼缃戦〉涓紝asr鏈嶅姟鍣ㄥ湴鍧�锛坵ebsocket srv鐨刬p涓庣鍙o級锛岀偣鍑诲紑濮嬪嵆鍙娇鐢ㄣ�傛敞鎰廻5鏈嶅姟鍜宎sr鏈嶅姟闇�瑕佸湪鍚屼竴涓湇鍔″櫒涓婏紝鍚﹀垯瀛樺湪璺ㄥ煙闂銆�
+
+
+
+[//]: # (## nginx閰嶇疆璇存槑(浜嗚В鐨勫彲浠ヨ烦杩�))
+
+[//]: # (h5鎵撳紑楹﹀厠椋庨渶瑕乭ttps鍗忚锛屽悓鏃跺悗绔殑asr websocket涔熷繀椤绘槸wss鍗忚锛屽鏋淸online asr](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/websocket)浠s鏂瑰紡杩愯锛屾垜浠彲浠ラ�氳繃nginx閰嶇疆瀹炵幇wss鍗忚鍒皐s鍗忚鐨勮浆鎹€��)
+
+[//]: # ()
+[//]: # (### nginx杞彂閰嶇疆绀轰緥)
+
+[//]: # (```shell)
+
+[//]: # (events { [0/1548])
+
+[//]: # ( worker_connections 1024;)
+
+[//]: # ( accept_mutex on;)
+
+[//]: # ( })
+
+[//]: # (http {)
+
+[//]: # ( error_log error.log;)
+
+[//]: # ( access_log access.log;)
+
+[//]: # ( server {)
+
+[//]: # ()
+[//]: # ( listen 5921 ssl http2; # nginx listen port for wss)
+
+[//]: # ( server_name www.test.com;)
+
+[//]: # ()
+[//]: # ( ssl_certificate /funasr/server.crt;)
+
+[//]: # ( ssl_certificate_key /funasr/server.key;)
+
+[//]: # ( ssl_protocols TLSv1 TLSv1.1 TLSv1.2;)
+
+[//]: # ( ssl_ciphers HIGH:!aNULL:!MD5;)
+
+[//]: # ()
+[//]: # ( location /wss/ {)
+
+[//]: # ()
+[//]: # ()
+[//]: # ( proxy_pass http://127.0.0.1:1111/; # asr online model ws address and port)
+
+[//]: # ( proxy_http_version 1.1;)
+
+[//]: # ( proxy_set_header Upgrade $http_upgrade;)
+
+[//]: # ( proxy_set_header Connection "upgrade";)
+
+[//]: # ( proxy_read_timeout 600s;)
+
+[//]: # ()
+[//]: # ( })
+
+[//]: # ( })
+
+[//]: # (```)
+
+[//]: # (### 淇敼wsconnecter.js閲宎sr鎺ュ彛鍦板潃)
+
+[//]: # (wsconnecter.js閲岄厤缃畂nline asr鏈嶅姟鍦板潃璺緞锛岃繖閲岄厤缃殑鏄痺ss绔彛)
+
+[//]: # (var Uri = "wss://xxx:xxx/wss/" )
+## Acknowledge
+1. This project is maintained by [FunASR community](https://github.com/alibaba-damo-academy/FunASR).
+2. We acknowledge [AiHealthx](http://www.aihealthx.com/) for contributing the html5 demo.
\ No newline at end of file
--
Gitblit v1.9.1