本页面描述了如何在 Windows 上构建 sherpa-ncnn。
有关 Python API,请参考 Python API。
MinGW 已知无法工作,请在继续之前安装
Visual Studio
。
64位 Windows (x64)
你只需要运行以下命令:
git clone https://github.com/k2-fsa/sherpa-ncnn
cd sherpa-ncnn
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
它将在 ./bin/Release/
目录下生成两个可执行文件:
sherpa-ncnn.exe
:用于解码单个 wav 文件。sherpa-ncnn-microphone.exe
:用于从麦克风进行实时语音识别。
就这样!
请阅读 预训练模型 了解生成的二进制文件的使用方法。
如果遇到任何问题,请在 https://github.com/k2-fsa/sherpa-ncnn/issues 创建一个问题。
32位 Windows (x86)
你只需要运行以下命令:
git clone https://github.com/k2-fsa/sherpa-ncnn
cd sherpa-ncnn
mkdir build
cd build
# Please select one toolset among VS 2015, 2017, 2019, and 2022 below
# We use VS 2022 as an example.
# For Visual Studio 2015
# cmake -T v140,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release ..
# For Visual Studio 2017
# cmake -T v141,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release ..
# For Visual Studio 2019
# cmake -T v142,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release ..
# For Visual Studio 2022
cmake -T v143,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release -- -m:6
它将在 ./bin/Release/
目录下生成两个可执行文件:
sherpa-ncnn.exe
:用于解码单个 wav 文件。sherpa-ncnn-microphone.exe
:用于从麦克风进行实时语音识别。
就这样!
请阅读 预训练模型 了解生成的二进制文件的使用方法。
如果遇到任何问题,请在 https://github.com/k2-fsa/sherpa-ncnn/issues 创建一个问题。