diff --git a/demos/speech_server/16_audio.wav b/demos/speech_server/16_audio.wav deleted file mode 100644 index 3cfa5074efaea618684e3ca7b497a2b1f33fa7e4..0000000000000000000000000000000000000000 Binary files a/demos/speech_server/16_audio.wav and /dev/null differ diff --git a/demos/speech_server/README.md b/demos/speech_server/README.md index b1d6b71f6ba5f7e2224a0d6df2776ba430d211b5..39007f6caacf8fa7924a2f0d74bfc734277f6a61 100644 --- a/demos/speech_server/README.md +++ b/demos/speech_server/README.md @@ -15,6 +15,13 @@ You can choose one way from easy, meduim and hard to install paddlespeech. ### 2. Prepare config File The configuration file contains the service-related configuration files and the model configuration related to the voice tasks contained in the service. They are all under the `conf` folder. +The input of ASR client demo should be a WAV file(`.wav`), and the sample rate must be the same as the model. + +Here are sample files for thisASR client demo that can be downloaded: +```bash +wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav https://paddlespeech.bj.bcebos.com/PaddleAudio/en.wav +``` + ### 3. Server Usage - Command Line (Recommended) @@ -71,7 +78,7 @@ The configuration file contains the service-related configuration files and the ### 4. ASR Client Usage - Command Line (Recommended) ``` - paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input ./16_audio.wav + paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input ./zh.wav ``` Usage: @@ -89,8 +96,9 @@ The configuration file contains the service-related configuration files and the Output: ```bash - [2022-02-23 11:19:45,646] [ INFO] - {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '广州医生跑北马中断比赛就心跳骤停者'}} - [2022-02-23 11:19:45,646] [ INFO] - time cost 0.659491 s. + [2022-02-23 18:11:22,819] [ INFO] - {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '我认为跑步最重要的就是给我带来了身体健康'}} + [2022-02-23 18:11:22,820] [ INFO] - time cost 0.689145 s. + ``` - Python API @@ -99,7 +107,7 @@ The configuration file contains the service-related configuration files and the asrclient_executor = ASRClientExecutor() asrclient_executor( - input="./16_audio.wav", + input="./zh.wav", server_ip="127.0.0.1", port=8090, sample_rate=16000, @@ -109,9 +117,8 @@ The configuration file contains the service-related configuration files and the Output: ```bash - {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '广州医生跑北马中断比赛就心跳骤停者'}} - time cost 0.802639 s. - + {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '我认为跑步最重要的就是给我带来了身体健康'}} + time cost 0.604353 s. ``` ### 5. TTS Client Usage @@ -214,4 +221,4 @@ Here is a list of **TTS pretrained static models** released by PaddleSpeech, bot | :--- | :---: | | pwgan_csmsc| zh | mb_melgan_csmsc| zh - | hifigan_csmsc| zh \ No newline at end of file + | hifigan_csmsc| zh diff --git a/demos/speech_server/README_cn.md b/demos/speech_server/README_cn.md index f97a85d3d499a7377091727fd04150d3cc3e3856..f56660705800f9d2061b222ec6cd412c7319b759 100644 --- a/demos/speech_server/README_cn.md +++ b/demos/speech_server/README_cn.md @@ -15,6 +15,13 @@ ### 2. 准备配置文件 配置文件包含服务相关的配置文件和服务中包含的语音任务相关的模型配置。 它们都在 `conf` 文件夹下。 +这个 ASR client 的输入应该是一个 WAV 文件(`.wav`),并且采样率必须与模型的采样率相同。 + +可以下载此 ASR client的示例音频: +```bash +wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav https://paddlespeech.bj.bcebos.com/PaddleAudio/en.wav +``` + ### 3. 服务端使用方法 - 命令行 (推荐使用) @@ -70,7 +77,7 @@ ### 4. ASR客户端使用方法 - 命令行 (推荐使用) ``` - paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input ./paddlespeech/server/tests/16_audio.wav + paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input ./zh.wav ``` 使用帮助: @@ -90,9 +97,8 @@ 输出: ```bash - [2022-02-23 11:19:45,646] [ INFO] - {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '广州医生跑北马中断比赛就心跳骤停者'}} - [2022-02-23 11:19:45,646] [ INFO] - time cost 0.659491 s. - + [2022-02-23 18:11:22,819] [ INFO] - {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '我认为跑步最重要的就是给我带来了身体健康'}} + [2022-02-23 18:11:22,820] [ INFO] - time cost 0.689145 s. ``` - Python API @@ -101,7 +107,7 @@ asrclient_executor = ASRClientExecutor() asrclient_executor( - input="./16_audio.wav", + input="./zh.wav", server_ip="127.0.0.1", port=8090, sample_rate=16000, @@ -111,8 +117,8 @@ 输出: ```bash - {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '广州医生跑北马中断比赛就心跳骤停者'}} - time cost 0.802639 s. + {'success': True, 'code': 200, 'message': {'description': 'success'}, 'result': {'transcription': '我认为跑步最重要的就是给我带来了身体健康'}} + time cost 0.604353 s. ``` @@ -213,4 +219,4 @@ | :--- | :---: | | pwgan_csmsc| zh | mb_melgan_csmsc| zh - | hifigan_csmsc| zh \ No newline at end of file + | hifigan_csmsc| zh diff --git a/demos/speech_server/asr_client.sh b/demos/speech_server/asr_client.sh index 1132263f4b80cea7846850a1b98607aacc62a742..afe2f82181aeab08194963d126f7621bc59b8b63 100644 --- a/demos/speech_server/asr_client.sh +++ b/demos/speech_server/asr_client.sh @@ -1,3 +1,4 @@ #!/bin/bash -paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input ./16_audio.wav +wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav https://paddlespeech.bj.bcebos.com/PaddleAudio/en.wav +paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input ./zh.wav