Java 및 C++ 용으로 작성된 음성 인식 API voce 음성 인식 API를 사용하고 있습니다. 아래 코드는출력 없음 오류 없음
#include "C:/Users/yohan/Documents/voce-0.9.1/src/c++/voce.h"
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
voce::init("C:/Users/yohan/Documents/voce-0.9.1/lib", true, false, "", "");
voce::synthesize("This is a speech synthesis test.");
voce::synthesize("Type a message to hear it spoken aloud.");
std::cout << "This is a speech synthesis test. "
<< "Type a message to hear it spoken aloud." << std::endl;
std::cout << "Type 's' + 'enter' to make the "
<< "synthesizer stop speaking. Type 'q' + 'enter' to quit."
<< std::endl;
std::string s;
while (s != "q")
{
// Read a line from keyboard.
std::getline(std::cin, s);
if ("s" == s)
{
voce::stopSynthesizing();
}
else
{
// Speak what was typed.
voce::synthesize(s);
}
}
voce::destroy();
// system("pause");
return 0;
}
이 코드를 실행하면 아무 것도 얻을 수 없습니다. 오류도 출력도없고, 콘솔 창을 열고 "press return exit"라고 말하면 그게 전부입니다! 메시지가 voce.h는 API 파일입니다
Starting C:\Users\yohan\Documents\QTPeojects\Tired-build-Desktop_Qt_5_0_0_beta2_MSVC2010_32bit_SDK-Release\release\Tired.exe...
C:\Users\yohan\Documents\QTPeojects\Tired-build-Desktop_Qt_5_0_0_beta2_MSVC2010_32bit_SDK-Release\release\Tired.exe exited with code 0
QT 콘솔에 인쇄 받고 있습니다 다음, 당신은 여기에서 할 수 있습니다. 이 헤더 파일은 Jni를 사용하여 Java 코드를 C++로 변환합니다. http://sourceforge.net/p/voce/code/HEAD/tree/src/c++/
도와주세요!
setRecognizerEnabled를 호출해야합니까? 또한 voce :: synthesize를 호출 한 후 isSynthesizing을 호출하여 true를 반환하는지 확인하십시오. 마지막으로, 콘솔 응용 프로그램을 사용하면 IDE에서 실행하는 것이 아니라 명령 줄에서 실행하는 것이 좋습니다. – TheDarkKnight