Speech recognition with Visual C++ MFC
This directory contains examples showing how to use Next-gen Kaldi in MFC for speech recognition.
| Directory | Pre-built exe (x64) | Pre-built exe (x86) | Description |
|---|---|---|---|
| ./NonStreamingSpeechRecognition | URL | URL | Non-streaming speech recognition |
| ./StreamingSpeechRecognition | URL | URL | Streaming speech recognition |
| ./NonStreamingTextToSpeech | URL | URL | Non-streaming text to speech |
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.
We use bash script below to demonstrate how to use it. Please change the commands accordingly for Windows.
How to compile
First, we need to compile sherpa-onnx:
mkdir -p $HOME/open-source
cd $HOME/open-source
git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=./install ..
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
./x64/Release/NonStreamingSpeechRecognition.exe
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
For instance, you can use the following addresses: