FunASR/funasr/runtime/html5
2023-06-29 13:31:21 +08:00
..
static h5 docs 2023-06-29 13:31:21 +08:00
demo.gif add html5 demo for online ws srv 2023-05-15 05:13:14 +00:00
h5Server.py html5 docs 2023-05-24 16:47:36 +08:00
readme_cn.md h5 (#617) 2023-06-12 15:37:36 +08:00
readme.md add html5 local access asr service directly (#654) 2023-06-20 11:08:50 +08:00
ssl_key html5 docs 2023-05-24 16:47:36 +08:00

Html5 server for asr service

Requirement

Install the modelscope and funasr

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

pip install flask
# pip install gevent (Optional)
# pip install pyOpenSSL (Optional)

javascript (Optional)

html5 recorder.js

Recorder 

demo

Steps

Html5 demo

usage: h5Server.py [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] [--keyfile KEYFILE]

e.g.

cd funasr/runtime/html5
python h5Server.py --host 0.0.0.0 --port 1337 

asr service

detail for asr

Tips: asr service and html5 service should be deployed on the same device.

cd ../python/websocket
python wss_srv_asr.py --port 10095

open browser to access html5 demo

https://127.0.0.1:1337/static/index.html
# https://30.220.136.139:1337/static/index.html

open browser to open html5 file directly without h5Server

you can run html5 client by just clicking the index.html file directly in your computer.

  1. lauch asr service without ssl, it must be in ws mode as ssl protocol will prohibit such access.
  2. copy whole directory /funasr/runtime/html5/static to your computer
  3. open /funasr/runtime/html5/static/index.html by browser
  4. enter asr service ws address and connect

Acknowledge

  1. This project is maintained by FunASR community.
  2. We acknowledge AiHealthx for contributing the html5 demo.