2023-07-12 13:37:28 +08:00
# Speech recognition with Visual C++ MFC
This directory contains examples showing how to use Next-gen Kaldi in MFC
for speech recognition.
2025-02-13 10:29:48 +08:00
|Directory| Pre-built exe (x64)|Pre-built exe (x86)| Description|
|---------|--------------------|-------------------|------------|
2025-06-03 21:55:49 +08:00
|[./NonStreamingSpeechRecognition ](./NonStreamingSpeechRecognition )|[URL ](https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.12.1/sherpa-onnx-non-streaming-asr-x64-v1.12.1.exe )|[URL ](https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.12.1/sherpa-onnx-non-streaming-asr-x86-v1.12.1.exe )| Non-streaming speech recognition|
|[./StreamingSpeechRecognition ](./StreamingSpeechRecognition )|[URL ](https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.12.1/sherpa-onnx-streaming-asr-x64-v1.12.1.exe )|[URL ](https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.12.1/sherpa-onnx-streaming-asr-x86-v1.12.1.exe )| Streaming speech recognition|
|[./NonStreamingTextToSpeech ](./NonStreamingTextToSpeech )|[URL ](https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.12.1/sherpa-onnx-non-streaming-tts-x64-v1.12.1.exe )|[URL ](https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.12.1/sherpa-onnx-non-streaming-tts-x86-v1.12.1.exe )| Non-streaming text to speech|
2025-02-13 10:29:48 +08:00
2023-07-14 17:00:14 +08:00
Caution: You need to use Windows and install Visual Studio 2022 in order to
compile it.
Hint: If you don't want to install Visual Studio, you can find below
about how to download pre-compiled `exe` .
2023-07-12 13:37:28 +08:00
We use bash script below to demonstrate how to use it. Please change
the commands accordingly for Windows.
2023-07-14 17:00:14 +08:00
## How to compile
First, we need to compile sherpa-onnx:
2023-07-12 13:37:28 +08:00
```bash
mkdir -p $HOME/open-source
cd $HOME/open-source
git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
mkdir build
2025-03-20 22:42:19 +00:00
cd build
2023-07-12 13:37:28 +08:00
2023-07-13 14:52:43 +08:00
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=./install ..
2023-07-12 13:37:28 +08:00
cmake --build . --config Release --target install
cd ../mfc-examples
msbuild ./mfc-examples.sln /property:Configuration=Release /property:Platform=x64
# now run the program
./x64/Release/StreamingSpeechRecognition.exe
2023-07-14 17:00:14 +08:00
./x64/Release/NonStreamingSpeechRecognition.exe
2023-07-12 13:37:28 +08:00
```
2023-07-14 17:00:14 +08:00
If you don't want to compile the project by yourself, you can download
pre-compiled `exe` from https://github.com/k2-fsa/sherpa-onnx/releases
2023-07-12 13:37:28 +08:00
2023-07-14 17:00:14 +08:00
For instance, you can use the following addresses:
2023-07-12 13:37:28 +08:00
2023-07-14 17:00:14 +08:00
- https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.5.1/sherpa-onnx-streaming-v1.5.1.exe
- https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.5.1/sherpa-onnx-non-streaming-v1.5.1.exe