### Dependencies via Make or Setup Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/dependencies.md List of dependencies that can be installed using make or a setup script. ```bash kenlm sox mfa openblas kaldi sctk AutoLog swig-decoder python_kaldi_features ``` -------------------------------- ### Setup Valgrind Tool Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/runtime/README.md Installs the Valgrind tool by executing a setup script located in the tools directory. Ensure you are in the correct directory or provide the full path. ```bash pushd tools ./setup_valgrind.sh popd ``` -------------------------------- ### Start MySQL and Milvus Services with Docker Compose Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/audio_searching/README.md Navigate to the audio_searching directory and start the necessary services using Docker Compose. Ensure Docker Engine and Docker Compose are installed. ```bash cd ~/PaddleSpeech/demos/audio_searching/ docker-compose -f docker-compose.yaml up -d ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/asr/quick_start.md Change the current directory to the 'examples/tiny' directory to access toy examples. ```bash cd examples/tiny ``` -------------------------------- ### PaddleSpeech Server Command Line Output Example Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_tts_server/README.md This is an example of the log output when the PaddleSpeech server starts successfully via the command line. ```text [2022-04-27 10:18:09,107] [ INFO] - The first response time of the 0 warm up: 1.1551103591918945 s [2022-04-27 10:18:09,219] [ INFO] - The first response time of the 1 warm up: 0.11204338073730469 s [2022-04-27 10:18:09,324] [ INFO] - The first response time of the 2 warm up: 0.1051797866821289 s [2022-04-27 10:18:09,325] [ INFO] - ********************************************************************** INFO: Started server process [17600] [2022-04-27 10:18:09] [INFO] [server.py:75] Started server process [17600] INFO: Waiting for application startup. [2022-04-27 10:18:09] [INFO] [on.py:45] Waiting for application startup. INFO: Application startup complete. [2022-04-27 10:18:09] [INFO] [on.py:59] Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8092 (Press CTRL+C to quit) [2022-04-27 10:18:09] [INFO] [server.py:211] Uvicorn running on http://0.0.0.0:8092 (Press CTRL+C to quit) ``` -------------------------------- ### Streaming ASR Server Output Example Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_asr_server/README.md Example output logs when starting the streaming ASR server, showing initialization steps and server status. ```text [2022-05-14 04:56:13,086] [ INFO] - create the online asr engine instance [2022-05-14 04:56:13,086] [ INFO] - paddlespeech_server set the device: cpu [2022-05-14 04:56:13,087] [ INFO] - Load the pretrained model, tag = conformer_online_wenetspeech-zh-16k [2022-05-14 04:56:13,087] [ INFO] - File /root/.paddlespeech/models/conformer_online_wenetspeech-zh-16k/asr1_chunk_conformer_wenetspeech_ckpt_1.0.0a.model.tar.gz md5 checking... [2022-05-14 04:56:17,542] [ INFO] - Use pretrained model stored in: /root/.paddlespeech/models/conformer_online_wenetspeech-zh-16k/asr1_chunk_conformer_wenetspeech_ckpt_1. 0.0a.model.tar [2022-05-14 04:56:17,543] [ INFO] - /root/.paddlespeech/models/conformer_online_wenetspeech-zh-16k/asr1_chunk_conformer_wenetspeech_ckpt_1.0.0a.model.tar [2022-05-14 04:56:17,543] [ INFO] - /root/.paddlespeech/models/conformer_online_wenetspeech-zh-16k/asr1_chunk_conformer_wenetspeech_ckpt_1.0.0a.model.tar/model.yaml [2022-05-14 04:56:17,543] [ INFO] - /root/.paddlespeech/models/conformer_online_wenetspeech-zh-16k/asr1_chunk_conformer_wenetspeech_ckpt_1.0.0a.model.tar/exp/ chunk_conformer/checkpoints/avg_10.pdparams [2022-05-14 04:56:17,543] [ INFO] - /root/.paddlespeech/models/conformer_online_wenetspeech-zh-16k/asr1_chunk_conformer_wenetspeech_ckpt_1.0.0a.model.tar/exp/ chunk_conformer/checkpoints/avg_10.pdparams [2022-05-14 04:56:17,852] [ INFO] - start to create the stream conformer asr engine [2022-05-14 04:56:17,863] [ INFO] - model name: conformer_online [2022-05-14 04:56:22,756] [ INFO] - create the transformer like model success [2022-05-14 04:56:22,758] [ INFO] - Initialize ASR server engine successfully. INFO: Started server process [4242] [2022-05-14 04:56:22] [INFO] [server.py:75] Started server process [4242] INFO: Waiting for application startup. [2022-05-14 04:56:22] [INFO] [on.py:45] Waiting for application startup. INFO: Application startup complete. [2022-05-14 04:56:22] [INFO] [on.py:59] Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit) [2022-05-14 04:56:22] [INFO] [server.py:211] Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit) ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/cls/quick_start.md Change the current directory to the audio classification examples for ESC50. ```bash cd examples/esc50/cls0 ``` -------------------------------- ### Install Miniconda and Initialize Conda Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Downloads and installs Miniconda, then initializes the conda environment for shell usage. ```bash # download the miniconda wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -P tools/ # install the miniconda bash tools/Miniconda3-latest-Linux-x86_64.sh -b # conda init $HOME/miniconda3/bin/conda init # use the "bash" command to make the conda environment works bash ``` -------------------------------- ### Install Sphinx and Theme Source: https://github.com/paddlepaddle/paddlespeech/wiki/Build-Doc-for-PaddleSpeech-API Installs Sphinx and the Read the Docs theme for documentation building. ```bash pip install Sphinx sphinx_rtd_theme ``` -------------------------------- ### Get Help for PaddleSpeech Server Command Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_tts_server/README.md View available arguments and options for the paddlespeech_server start command. ```bash paddlespeech_server start --help ``` -------------------------------- ### Install Frontend Dependencies with Yarn Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/speech_web/README.md Change to the web_client directory, install Yarn globally if not already present, and then use Yarn to install frontend dependencies. Node.js and npm are prerequisites. ```bash cd web_client # Install `yarn`, skip if already installed npm install -g yarn # Install frontend dependencies using yarn yarn install cd ../ ``` -------------------------------- ### Install PaddlePaddle and PaddleSpeech Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Installs the PaddlePaddle deep learning framework and the PaddleSpeech library using specified PyPI mirrors. Ensure Python >= 3.7 is installed. ```bash pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple pip install paddlespeech -i https://pypi.tuna.tsinghua.edu.cn/simple ``` -------------------------------- ### Download and Install Miniconda Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/install.md Downloads the Miniconda installer, installs it silently, initializes conda for the current shell, and creates a Python 3.8 virtual environment. ```bash # download the miniconda wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -P tools/ # install the miniconda bash tools/Miniconda3-latest-Linux-x86_64.sh -b # conda init $HOME/miniconda3/bin/conda init # use the "bash" command to make the conda environment works bash # create a conda virtual environment conda create -y -p tools/venv python=3.8 # Activate the conda virtual environment: conda activate tools/venv # Install the conda packages conda install -y -c conda-forge sox libsndfile swig bzip2 libflac bc ``` -------------------------------- ### Install warpctc_pytorch Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/topic/ctc/ctc_loss_compare.ipynb This snippet shows the output of installing the warpctc_pytorch library. It details the build process and final installation steps. ```shell running install running bdist_egg running egg_info writing warpctc_pytorch.egg-info/PKG-INFO writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt writing top-level names to warpctc_pytorch.egg-info/top_level.txt writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext building 'warpctc_pytorch._warp_ctc' extension Emitting ninja build file /workspace/zhanghui/DeepSpeech-2.x/docs/topic/ctc/warp-ctc/pytorch_binding/build/temp.linux-x86_64-3.9/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) ninja: no work to do. g++ -pthread -B /workspace/zhanghui/DeepSpeech-2.x/tools/venv/compiler_compat -Wl,--sysroot=/ -shared -Wl,-rpath,/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib -Wl,-rpath-link,/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib -L/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib -Wl,-rpath,/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib -Wl,-rpath-link,/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib -L/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib /workspace/zhanghui/DeepSpeech-2.x/docs/topic/ctc/warp-ctc/pytorch_binding/build/temp.linux-x86_64-3.9/src/binding.o -L/workspace/zhanghui/DeepSpeech-2.x/docs/topic/ctc/warp-ctc/build -L/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib/python3.9/site-packages/torch/lib -L/usr/local/cuda/lib64 -lwarpctc -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-3.9/warpctc_pytorch/_warp_ctc.cpython-39-x86_64-linux-gnu.so -Wl,-rpath,/workspace/zhanghui/DeepSpeech-2.x/docs/topic/ctc/warp-ctc/build creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/warpctc_pytorch copying build/lib.linux-x86_64-3.9/warpctc_pytorch/__init__.py -> build/bdist.linux-x86_64/egg/warpctc_pytorch copying build/lib.linux-x86_64-3.9/warpctc_pytorch/_warp_ctc.cpython-39-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/warpctc_pytorch byte-compiling build/bdist.linux-x86_64/egg/warpctc_pytorch/__init__.py to __init__.cpython-39.pyc creating stub loader for warpctc_pytorch/_warp_ctc.cpython-39-x86_64-linux-gnu.so byte-compiling build/bdist.linux-x86_64/egg/warpctc_pytorch/_warp_ctc.py to _warp_ctc.cpython-39.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying warpctc_pytorch.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying warpctc_pytorch.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying warpctc_pytorch.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying warpctc_pytorch.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt zip_safe flag not set; analyzing archive contents... warpctc_pytorch.__pycache__._warp_ctc.cpython-39: module references __file__ creating 'dist/warpctc_pytorch-0.1-py3.9-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing warpctc_pytorch-0.1-py3.9-linux-x86_64.egg removing '/workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib/python3.9/site-packages/warpctc_pytorch-0.1-py3.9-linux-x86_64.egg' (and everything under it) creating /workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib/python3.9/site-packages/warpctc_pytorch-0.1-py3.9-linux-x86_64.egg Extracting warpctc_pytorch-0.1-py3.9-linux-x86_64.egg to /workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib/python3.9/site-packages warpctc-pytorch 0.1 is already the active version in easy-install.pth Installed /workspace/zhanghui/DeepSpeech-2.x/tools/venv/lib/python3.9/site-packages/warpctc_pytorch-0.1-py3.9-linux-x86_64.egg Processing dependencies for warpctc-pytorch==0.1 Finished processing dependencies for warpctc-pytorch==0.1 ``` -------------------------------- ### Start PaddleSpeech Server Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/README.md Use this command to start the main PaddleSpeech server. Ensure you have a configuration file ready. ```shell paddlespeech_server start --config_file ./demos/speech_server/conf/application.yaml ``` -------------------------------- ### Install Triton Client Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_tts_serving_fastdeploy/README.md Installs the Triton client library with all necessary dependencies for interacting with the serving endpoint. ```bash pip3 install tritonclient[all] ``` -------------------------------- ### Install Build Dependencies (Ubuntu) Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/TTSArmLinux/README.md Installs essential build tools and utilities for compiling on Ubuntu systems. ```bash # Ubuntu sudo apt install build-essential cmake pkg-config wget tar unzip ``` -------------------------------- ### PaddleSpeech Server Python API Output Example Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_tts_server/README.md This is an example of the log output when the PaddleSpeech server starts successfully using the Python API. ```text [2022-04-27 10:20:16,660] [ INFO] - The first response time of the 0 warm up: 1.0945196151733398 s [2022-04-27 10:20:16,773] [ INFO] - The first response time of the 1 warm up: 0.11222052574157715 s [2022-04-27 10:20:16,878] [ INFO] - The first response time of the 2 warm up: 0.10494542121887207 s [2022-04-27 10:20:16,878] [ INFO] - ********************************************************************** INFO: Started server process [23466] [2022-04-27 10:20:16] [INFO] [server.py:75] Started server process [23466] INFO: Waiting for application startup. [2022-04-27 10:20:16] [INFO] [on.py:45] Waiting for application startup. INFO: Application startup complete. [2022-04-27 10:20:16] [INFO] [on.py:59] Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8092 (Press CTRL+C to quit) [2022-04-27 10:20:16] [INFO] [server.py:211] Uvicorn running on http://0.0.0.0:8092 (Press CTRL+C to quit) ``` -------------------------------- ### Run Main Demo Script Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/asr/quick_start.md Execute the 'run.sh' script to start the main demonstration. Ensure each step works before proceeding to the next. ```bash bash run.sh ``` -------------------------------- ### Download and Setup MFA Tools Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/examples/other/tts_finetune/tts3/README.md Download the Montreal Forced Aligner (MFA) tools and perform initial setup, including copying a shared library. ```bash mkdir -p tools && cd tools # mfa tool wget https://github.com/MontrealCorpusTools/Montreal-Forced-Aligner/releases/download/v1.0.1/montreal-forced-aligner_linux.tar.gz tar xvf montreal-forced-aligner_linux.tar.gz cp montreal-forced-aligner/lib/libpython3.6m.so.1.0 montreal-forced-aligner/lib/libpython3.6m.so mkdir -p aligner && cd aligner ``` -------------------------------- ### Prepare Data and Environment for Benchmark Training Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/tests/test_tipc/docs/benchmark_train.md Run this script from the repository root to prepare training data and install necessary environments. It requires a configuration file and a mode argument. ```shell bash test_tipc/prepare.sh test_tipc/configs/conformer/train_benchmark.txt benchmark_train ``` -------------------------------- ### Run DeepSpeech2 Stages Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/examples/librispeech/asr0/README.md Execute a range of stages in the DeepSpeech2 ASR example by specifying the start and stop stages. ```bash bash run.sh --stage 2 --stop_stage 3 ``` ```bash bash run.sh --stage 0 --stop_stage 0 ``` -------------------------------- ### Streaming TTS Client Output Example Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_tts_server/README.md This is an example of the output logs produced by the streaming TTS client when run via the command line. It shows synthesis start, sentence processing, response times, audio duration, and save location. ```text [2022-04-27 10:21:04,262] [ INFO] - tts websocket client start [2022-04-27 10:21:04,496] [ INFO] - 句子:您好,欢迎使用百度飞桨语音合成服务。 [2022-04-27 10:21:04,496] [ INFO] - 首包响应:0.2124948501586914 s [2022-04-27 10:21:07,483] [ INFO] - 尾包响应:3.199106454849243 s [2022-04-27 10:21:07,484] [ INFO] - 音频时长:3.825 s [2022-04-27 10:21:07,484] [ INFO] - RTF: 0.8363677006141812 [2022-04-27 10:21:07,516] [ INFO] - 音频保存至:output.wav ``` -------------------------------- ### Install pytest-runner Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Install 'pytest-runner' to potentially resolve issues with installing 'kaldiio' from its default download source. This is a prerequisite for installing PaddleSpeech. ```bash # Some users may fail to install `kaldiio` due to the default download source, you can install `pytest-runner` at first; pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple ``` -------------------------------- ### Run TTS Frontend Demo with Help Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/TTSCppFrontend/README.md Executes the TTS frontend demo and displays its command-line help information. ```bash ./run_front_demo.sh --help ``` -------------------------------- ### Install PaddleSpeech Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/install.md Install PaddleSpeech from the source code after cloning the repository. It's recommended to install `pytest-runner` first if `kaldiio` installation fails. ```bash # Some users may fail to install `kaldiio` due to the default download source, you can install `pytest-runner` at first ; pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple # Make sure you are in the root directory of PaddleSpeech pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple ``` -------------------------------- ### Download and Play Example Audio Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/tutorial/cls/cls_tutorial.ipynb Downloads a sample audio file ('dog.wav') if it doesn't exist and then plays it using IPython.display.Audio. ```python # 获取示例音频 !test -f ./dog.wav || wget https://paddlespeech.cdn.bcebos.com/PaddleAudio/dog.wav IPython.display.Audio('./dog.wav') ``` -------------------------------- ### Download and Install Miniconda Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Download and install Miniconda for environment management on Linux/macOS. This script downloads the installer, installs it silently, initializes Conda, and activates the shell. ```bash # download the miniconda wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -P tools/ # install the miniconda bash tools/Miniconda3-latest-Linux-x86_64.sh -b # conda init $HOME/miniconda3/bin/conda init # activate the conda bash ``` -------------------------------- ### Install PaddleSpeech Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/tutorial/cls/cls_tutorial.ipynb Installs the necessary PaddleSpeech library and its dependencies. Ensure you have a compatible version of PaddlePaddle installed. ```python # 环境准备:安装paddlespeech !pip install -U pip paddlepaddle-gpu && pip install paddlespeech ``` -------------------------------- ### Start PaddleSpeech Server via Command Line Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_tts_server/README.md Use this command to start the PaddleSpeech server. Specify the configuration file for application settings. The default configuration uses HTTP. ```bash paddlespeech_server start --config_file ./conf/tts_online_application.yaml ``` -------------------------------- ### Prepare Benchmark Environment Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/tests/benchmark/conformer/README.md Execute this script to set up the necessary environment for running the benchmark tests. ```bash bash prepare.sh ``` -------------------------------- ### Install PaddleAudio Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/audio/README.md Use this command to install PaddleAudio via pip. Ensure you have Python and pip installed. ```bash pip install paddleaudio ``` -------------------------------- ### Set Installation Prefix Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/runtime/CMakeLists.txt Specifies the installation directory for the project's artifacts to be within the build's 'install' subdirectory. ```cmake set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install) ``` -------------------------------- ### Run Example with Custom Variables Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/examples/librispeech/asr2/README.md Execute the run.sh script with custom values for --gpus and --avg_num to control GPU usage and model averaging. ```bash bash run.sh --gpus 0,1 --avg_num 10 ``` -------------------------------- ### Install PaddleSpeech via Pip Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/README_cn.md Installs PaddleSpeech and its necessary testing runner using pip. This is a quick installation method. ```shell pip install pytest-runner pip install paddlespeech ``` -------------------------------- ### Start the API Server Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/audio_searching/README.md Start the system server using FastAPI. Ensure the PYTHONPATH is set correctly to include the src directory. ```bash export PYTHONPATH=$PYTHONPATH:./src python src/audio_search.py ``` -------------------------------- ### Install PaddlePaddle (CPU Version) Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/README_cn.md Installs the CPU version of PaddlePaddle using pip. Ensure you have Python 3.8+ and GCC 4.8.5+ installed. ```shell pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple ``` -------------------------------- ### Generate API Docs (Example 2) Source: https://github.com/paddlepaddle/paddlespeech/wiki/Build-Doc-for-PaddleSpeech-API Generates API documentation for the paddlespeech package into the specified output directory. ```bash sphinx-apidoc -o ./docs/source/api ./paddlespeech -f -e -M ``` -------------------------------- ### Install SCLITE and Run G2P Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/examples/other/g2p/README.md Installs the SCLITE tool for evaluation and then runs the G2P test. Ensure you have downloaded and extracted the BZNSYP dataset. ```bash cd ../../../tools bash extras/install_sclite.sh cd - ./run.sh ``` -------------------------------- ### Download Sample Audio Files Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/audio_tagging/README.md Use wget to download sample WAV files for testing the audio tagging demo. ```bash wget -c https://paddlespeech.cdn.bcebos.com/PaddleAudio/cat.wav https://paddlespeech.cdn.bcebos.com/PaddleAudio/dog.wav ``` -------------------------------- ### Install Conda Dependencies for PaddleSpeech Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Installs necessary dependencies like sox, libsndfile, and bzip2 using Conda. Ensure you have Conda installed and configured. ```bash conda install -y -c conda-forge sox libsndfile bzip2 ``` -------------------------------- ### Install PaddleSpeech Backend Dependencies Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/speech_web/README.md Navigate to the speech_server directory and install backend dependencies using pip. Ensure you have PaddleSpeech installed prior to this step. ```bash cd speech_server pip install -r requirements.txt -i https://mirror.baidu.com/pypi/simple cd ../ ``` -------------------------------- ### Start Punctuation Service using Command Line Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_asr_server/README.md Launches the punctuation service server from the command line. Ensure you are in the correct directory. The server defaults to CPU but can be configured for GPU. ```bash In PaddleSpeech/demos/streaming_asr_server directory to launch punctuation service paddlespeech_server start --config_file conf/punc_application.yaml ``` -------------------------------- ### Install PaddleSpeech Package Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Install the PaddleSpeech package from the root directory of the cloned repository. This command installs the library and makes its major functions available for use. ```bash # Make sure you are in the root directory of PaddleSpeech pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple ``` -------------------------------- ### Install GCC/G++ via Conda Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Install specific versions of GCC and G++ using Conda. This is an alternative method for systems where direct installation might be complex or unavailable. ```bash # Others conda install -y -c gcc_linux-64=8.4.0 gxx_linux-64=8.4.0 ``` -------------------------------- ### Download Demo Sources Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/tutorial/tts/tts_tutorial.ipynb Downloads necessary files for the TTS tutorial, including images, audio, and video. ```python # download demo sources !mkdir download !wget -P download https://paddlespeech.cdn.bcebos.com/tutorial/tts/ocr_result.jpg !wget -P download https://paddlespeech.cdn.bcebos.com/tutorial/tts/ocr.wav !wget -P download https://paddlespeech.cdn.bcebos.com/tutorial/tts/tts_lips.mp4 ``` -------------------------------- ### Download and Prepare Pretrained Model Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/examples/librispeech/asr2/README.md Download a pretrained ASR model, unpack it, and prepare data for testing. Assumes data processing might be skipped if manifests are already available. ```bash wget https://paddlespeech.cdn.bcebos.com/s2t/librispeech/asr2/asr2_transformer_librispeech_ckpt_0.1.1.model.tar.gz tar xzvf asr2_transformer_librispeech_ckpt_0.1.1.model.tar.gz source path.sh # If you have process the data and get the manifest file, you can skip the following 2 steps bash local/data.sh --stage -1 --stop_stage -1 bash local/data.sh --stage 2 --stop_stage 2 CUDA_VISIBLE_DEVICES= ./local/test.sh conf/transformer.yaml exp/ctc/checkpoints/avg_10 ``` -------------------------------- ### Install PaddleSpeech Dependencies Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/audio_content_search/README.md Install the necessary dependencies for PaddleSpeech by running this command. ```bash pip install -r requirements.txt ``` -------------------------------- ### Launch Speaker Verification Server Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/paddlespeech/server/README.md Starts the speaker verification server using a specific configuration file. ```bash paddlespeech_server start --config_file conf/vector_application.yaml ``` -------------------------------- ### Install VAD Library and Dependencies Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/runtime/engine/vad/nnet/CMakeLists.txt Installs the VAD library and platform-specific glog library. ```cmake file(RELATIVE_PATH DEST_DIR ${ENGINE_ROOT} ${CMAKE_CURRENT_SOURCE_DIR}) install(TARGETS pps_vad DESTINATION lib) if(ANDROID) install(TARGETS extern_glog DESTINATION lib) else() # UNIX install(TARGETS glog DESTINATION lib) endif() ``` -------------------------------- ### Install PaddleSpeech and PaddlePaddle Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/tutorial/st/st_tutorial.ipynb Installs the latest versions of PaddleSpeech and PaddlePaddle (GPU version). ```python !pip install -U pip paddlepaddle-gpu && pip install paddlespeech ``` -------------------------------- ### Download Sample Audio File Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/speech_ssl/README.md Use wget to download a sample English audio file for testing the Speech SSL demo. ```bash wget -c https://paddlespeech.cdn.bcebos.com/PaddleAudio/en.wav ``` -------------------------------- ### Install Conda Packages Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/install.md Installs necessary audio and development packages using conda. ```bash # Install the conda packages conda install -y -c conda-forge sox libsndfile swig bzip2 libflac bc ``` -------------------------------- ### Install pytest-benchmark Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/audio/tests/benchmark/README.md Install the pytest-benchmark package using pip. This is a prerequisite for running the benchmarks. ```sh pip install pytest-benchmark ``` -------------------------------- ### Run Main Entry Point for Audio Classification Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/docs/source/audio/cls/quick_start.md Execute the main script to start the audio classification process. Adjust CUDA_VISIBLE_DEVICES for GPU or CPU usage. ```bash CUDA_VISIBLE_DEVICES=0 ./run.sh 1 ``` -------------------------------- ### Start Streaming ASR Server Source: https://github.com/paddlepaddle/paddlespeech/blob/develop/demos/streaming_asr_server/web/readme.md Starts the streaming ASR server using a specified configuration file. Navigate to the demo directory and execute this command. ```bash cd PaddleSpeech/demos/streaming_asr_server paddlespeech_server start --config_file conf/ws_conformer_wenetspeech_application_faster.yaml ```