Closed yinfan98 closed 12 months ago
Can I complete the compilation process by using the following code without separately compiling Kaldi?
You can compile this way, yes
Is the same compilation process required when using C#?
You can use precompiled binary too
Thank you for your response, and where can I find the precompiled binary
I found that when using the C++ API, directly using printf to output Chinese characters in a Windows environment does not produce the correct results. This is because I obtained a UTF-8 encoded char* string. Therefore, I need to perform character encoding conversion to obtain the correct output. I referred to the response from #973 and modified the conversion code based on it.
973 I use this function to decoding UTF-8 to string, it works!
std::string UTF8ToString(const char* utf8Data)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
std::wstring wString = conv.from_bytes(utf8Data); // utf-8 => wstring
std::wstring_convert<std::codecvt<wchar_t, char, std::mbstate_t>> convert(
new std::codecvt<wchar_t, char, std::mbstate_t>("CHS"));
std::string str = convert.to_bytes(wString); // wstring => string
return str;
}
Hi, I am having some issues while using the C or C# API.
cd <KALDI_ROOT> git clone -b vosk --single-branch --depth=1 https://github.com/alphacep/kaldi /opt/kaldi cd kaldi/tools make openfst cub ./extras/install_openblas_clapack.sh cd ../src ./configure --mathlib=OPENBLAS_CLAPACK --shared make -j 10 online2 lm rnnlm cd ../.. git clone https://github.com/alphacep/vosk-api --depth=1 cd vosk-api/src KALDI_ROOT=<KALDI_ROOT> make