Witam,
chciałem pobawić się biblioteką do rozpoznawania mowy Voce, ale natrafiłem na pewne problemy. Użyłem programu przykładowego dostarczonego z biblioteką, zmieniałem tylko lokalizację pliku voce.jar. Program się kompiluje, ale po odpaleniu wyświetla się napis:
Error occurred during initialization of VM
Unable to load native library: Can't find dependent librariesProcess returned 1 (0x1) execution time : 2.609 s
Press any key to continue.
Szukałem już rozwiązań tego problemu, znalazłem, że trzeba dodać ścieżkę do jvm.dll do PATH, jednak po zrobieniu tego problem nadal występuje. Proszę o pomoc w rozwiązaniu tego problemu.
System Windows XP, 32-bit
Środowisko Code::Blocks 13.12 z MinGW
main.cpp:
/*************************************************************************
* *
* Voce *
* Copyright (C) 2005 *
* Tyler Streeter [email protected] *
* All rights reserved. *
* Web: voce.sourceforge.net *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file license-LGPL.txt. *
* (2) The BSD-style license that is included with this library in *
* the file license-BSD.txt. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* license-LGPL.txt and license-BSD.txt for more details. *
* *
*************************************************************************/
#include <voce.h>
#include <string>
#include <jni.h>
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
/// A sample application showing how to use Voce's speech synthesis
/// capabilities.
int main(int argc, char **argv)
{
voce::init("C:/Downloads/lib", false, true, "C:/Downloads/gram", "digits");
std::cout << "This is a speech recognition test. "
<< "Speak digits from 0-9 into the microphone. "
<< "Speak 'quit' to quit." << std::endl;
bool quit = false;
while (!quit)
{
// Normally, applications would do application-specific things
// here. For this sample, we'll just sleep for a little bit.
#ifdef WIN32
::Sleep(200);
#else
usleep(200);
#endif
while (voce::getRecognizerQueueSize() > 0)
{
std::string s = voce::popRecognizedString();
// Check if the string contains 'quit'.
if (std::string::npos != s.rfind("quit"))
{
quit = true;
}
std::cout << "You said: " << s << std::endl;
//voce::synthesize(s);
}
}
voce::destroy();
return 0;
}
voce.h:
https://github.com/rpavlik/voce/blob/master/src/c%2B%2B/voce.h