| | |
| | | ### Install the requirements for server |
| | | |
| | | ```shell |
| | | cd funasr/runtime/python/websocket |
| | | cd runtime/python/websocket |
| | | pip install -r requirements_server.txt |
| | | ``` |
| | | |
| | |
| | | |
| | | #### 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) |
| | | # 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 |