Client for java websocket example
# in ubuntu
apt-get install openjdk-11-jdk
cd funasr/runtime/java
# download java lib
make downjar
# compile
make buildwebsocket
# run client
make runclient
Run java websocket client by shell
# full command refer to Makefile runclient
usage: FunasrWsClient [-h] [--port PORT] [--host HOST] [--audio_in AUDIO_IN] [--num_threads NUM_THREADS]
[--chunk_size CHUNK_SIZE] [--chunk_interval CHUNK_INTERVAL] [--mode MODE]
Where:
--host < string>
(required) server-ip
--port < int>
(required) port
--audio_in < string>
(required) the wav or pcm file path
--num_threads < int>
thread number for test
--mode
asr mode, support " offline" " online" " 2pass"
example:
FunasrWsClient --host localhost --port 8889 --audio_in ./asr_example.wav --num_threads 1 --mode 2pass
result json, example like:
{" mode" :" offline" ," text" :" 欢迎大家来体验达摩院推出的语音识别模型" ," wav_name" :" javatest" }
This project is maintained by FunASR community .
We acknowledge zhaoming for contributing the java websocket client example.