From 6724b7a62441d63165f406f654de7e829227279e Mon Sep 17 00:00:00 2001 From: 游雁 <zhifu.gzf@alibaba-inc.com> Date: 星期三, 24 五月 2023 10:57:26 +0800 Subject: [PATCH] html5 docs --- funasr/runtime/html5/static/index.html | 2 funasr/runtime/html5/readme_cn.md | 62 ++++++++++++++++++------------ 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/funasr/runtime/html5/readme_cn.md b/funasr/runtime/html5/readme_cn.md index 5037697..2ad5db2 100644 --- a/funasr/runtime/html5/readme_cn.md +++ b/funasr/runtime/html5/readme_cn.md @@ -1,52 +1,64 @@ -# online asr demo for html5 +# Html5 server for asr service -## requirement +## Requirement ### python ```shell -flask -gevent -pyOpenSSL +pip install flask +# pip install gevent (Optional) +# pip install pyOpenSSL (Optional) ``` -### javascript +### javascript (Optional) [html5褰曢煶](https://github.com/xiangyuecn/Recorder) ```shell Recorder ``` -### demo椤甸潰濡備笅 +## demo椤甸潰濡備笅  -## 涓ょws_server_online杩炴帴妯″紡 +## 涓ょws_server杩炴帴妯″紡 ### 1)鐩存帴杩炴帴妯″紡锛屾祻瑙堝櫒https楹﹀厠椋� --> html5 demo鏈嶅姟 --> js wss鎺ュ彛 --> wss asr online srv(璇佷功鐢熸垚璇峰線鍚庣湅) ### 2)nginx涓浆锛屾祻瑙堝櫒https楹﹀厠椋� --> html5 demo鏈嶅姟 --> js wss鎺ュ彛 --> nginx鏈嶅姟 --> ws asr online srv -## 1.html5 demo鏈嶅姟鍚姩 -### 鍚姩html5鏈嶅姟锛岄渶瑕乻sl璇佷功(鑷繁鐢熸垚璇峰線鍚庣湅) +## 鎿嶄綔姝ラ +### html5 demo鏈嶅姟鍚姩 +#### 鍚姩html5鏈嶅姟锛岄渶瑕乻sl璇佷功(宸茬敓鎴愶紝濡傞渶瑕佽嚜宸辩敓鎴愯寰�鍚庣湅) +鐢ㄦ硶濡備笅: +```shell +h5Server.py [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] [--keyfile KEYFILE] +``` +渚嬪瓙濡備笅锛岄渶瑕佹敞鎰廼p鍦板潃锛屽鏋滀粠鍏朵粬璁惧璁块棶闇�姹傦紙渚嬪鎵嬫満绔級锛岄渶瑕佸皢ip鍦板潃璁句负鐪熷疄ip +```shell +python h5Server.py --host 0.0.0.0 --port 1337 --keyfile server.key +# python h5Server.py --host 30.220.136.139 --port 1337 --keyfile server.key +``` +### 鍚姩ws or wss asr online srv +[鍏蜂綋璇风湅online asr](../python/websocket) +online asr鎻愪緵涓ょwss鍜寃s妯″紡锛寃ss妯″紡鍙互鐩存帴鍚姩锛屾棤闇�nginx涓浆銆傚惁鍒欓渶瑕侀�氳繃nginx灏唚ss杞彂鍒拌online asr鐨剋s绔彛涓� +`Tips:` asr 鏈嶅姟闇�瑕佷笌html5鏈嶅姟閮ㄧ讲鍒板悓涓�涓墿鐞嗘満鍣ㄤ笂 +#### wss鏂瑰紡 ```shell -usage: h5Server.py [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] - [--keyfile KEYFILE] -python h5Server.py --port 1337 --keyfile server.key +cd ../python/websocket +python ws_server_online.py --certfile ../../html5/server.crt --keyfile ../../html5/server.key --port 1095 ``` -## 2.鍚姩ws or wss asr online srv -[鍏蜂綋璇风湅online asr](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/websocket) -online asr鎻愪緵涓ょws鍜寃ss妯″紡锛寃ss妯″紡鍙互鐩存帴鍚姩锛屾棤闇�nginx涓浆銆傚惁鍒欓渶瑕侀�氳繃nginx灏唚ss杞彂鍒拌online asr鐨剋s绔彛涓� -### wss鏂瑰紡 +#### ws鏂瑰紡 ```shell -python ws_server_online.py --certfile server.crt --keyfile server.key --port 5921 -``` -### ws鏂瑰紡 -```shell -python ws_server_online.py --port 5921 +cd ../python/websocket +python ws_server_online.py --port 1095 ``` -## 3.娴忚鍣ㄦ墦寮�鍦板潃娴嬭瘯,璇锋牴鎹疄闄卛p濉啓 +### 娴忚鍣ㄦ墦寮�鍦板潃 +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 +``` -## 4.淇敼缃戦〉閲宎sr鎺ュ彛鍦板潃 -鐩存帴缃戦〉閲屼慨鏀瑰悗锛岀偣鍑诲紑濮嬪嵆鍙娇鐢ㄣ�傛敞鎰廻5鏈嶅姟鍜宎sr鏈嶅姟闇�瑕佸湪鍚屼竴涓湇鍔″櫒涓婏紝鍚﹀垯瀛樺湪璺ㄥ煙闂銆� +### 淇敼缃戦〉閲宎sr鎺ュ彛鍦板潃 +淇敼缃戦〉涓紝asr鏈嶅姟鍣ㄥ湴鍧�锛坵ebsocket srv鐨刬p涓庣鍙o級锛岀偣鍑诲紑濮嬪嵆鍙娇鐢ㄣ�傛敞鎰廻5鏈嶅姟鍜宎sr鏈嶅姟闇�瑕佸湪鍚屼竴涓湇鍔″櫒涓婏紝鍚﹀垯瀛樺湪璺ㄥ煙闂銆� ## 鑷鐢熸垚璇佷功 diff --git a/funasr/runtime/html5/static/index.html b/funasr/runtime/html5/static/index.html index ba33c8e..3bc0fc8 100644 --- a/funasr/runtime/html5/static/index.html +++ b/funasr/runtime/html5/static/index.html @@ -19,7 +19,7 @@ <div class="div_class_recordControl"> asr鏈嶅姟鍣ㄥ湴鍧�(蹇呭~): <br> - <input id="wssip" type="text" style=" width: 100%;height:100%" value="wss://127.0.0.1:5921/"/> + <input id="wssip" type="text" style=" width: 100%;height:100%" value="wss://127.0.0.1:1095/"/> <br> <br> 璇煶璇嗗埆缁撴灉鏄剧ず锛� -- Gitblit v1.9.1