cmusphinx / node-pocketsphinx

Pocketsphinx bindings for Node.JS
Other
242 stars 47 forks source link

error: too few arguments to function #7

Closed jwhu1024 closed 9 years ago

jwhu1024 commented 9 years ago

What the version of pocketsphinx was the demo used? It seems the prototype not matching..

../src/Recognizer.cpp:308:58: error: too few arguments to function ‘const char* ps_get_hyp(ps_decodert, int32_, const char)’ const char* hyp = ps_get_hyp(data->instance->ps, &score);**

full log as below Vostro-5470:~/homework/speech_recognition/node-pocketsphinx$ sudo node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@1.0.3 gyp info using node@0.10.32 | linux | x64 gyp info spawn python gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/home/lester/homework/speech_recognition/node-pocketsphinx/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/home/lester/.node-gyp/0.10.32/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/lester/.node-gyp/0.10.32', gyp info spawn args '-Dmodule_root_dir=/home/lester/homework/speech_recognition/node-pocketsphinx', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory /home/lester/homework/speech_recognition/node-pocketsphinx/build' CXX(target) Release/obj.target/PocketSphinx/src/Factory.o CXX(target) Release/obj.target/PocketSphinx/src/Recognizer.o ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::AddKeyphraseSearch(const v8::Arguments&)’: ../src/Recognizer.cpp:109:64: error: ‘ps_set_keyphrase’ was not declared in this scope int result = ps_set_keyphrase(instance->ps, *name, *keyphrase); ^ ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::AddKeywordsSearch(const v8::Arguments&)’: ../src/Recognizer.cpp:133:53: error: ‘ps_set_kws’ was not declared in this scope int result = ps_set_kws(instance->ps, *name, *file); ^ ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::AddGrammarSearch(const v8::Arguments&)’: ../src/Recognizer.cpp:157:59: error: ‘ps_set_jsgf_file’ was not declared in this scope int result = ps_set_jsgf_file(instance->ps, *name, *file); ^ ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::AddNgramSearch(const v8::Arguments&)’: ../src/Recognizer.cpp:181:57: error: ‘ps_set_lm_file’ was not declared in this scope int result = ps_set_lm_file(instance->ps, *name, *file); ^ ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::GetSearch(v8::Local<v8::String>, const v8::AccessorInfo&)’: ../src/Recognizer.cpp:191:69: error: ‘ps_get_search’ was not declared in this scope Local<Value> search = String::NewSymbol(ps_get_search(instance->ps)); ^ ../src/Recognizer.cpp: In static member function ‘static void Recognizer::SetSearch(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&)’: ../src/Recognizer.cpp:201:38: error: ‘ps_set_search’ was not declared in this scope ps_set_search(instance->ps, *search); ^ ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::Start(const v8::Arguments&)’: ../src/Recognizer.cpp:207:41: error: too few arguments to function ‘int ps_start_utt(ps_decoder_t*, const char*)’ int result = ps_start_utt(instance->ps); ^ In file included from ../src/Recognizer.h:7:0, from ../src/Recognizer.cpp:2: /usr/include/pocketsphinx/pocketsphinx.h:363:5: note: declared here int ps_start_utt(ps_decoder_t *ps, char const *uttid); ^ ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::Restart(const v8::Arguments&)’: ../src/Recognizer.cpp:227:41: error: too few arguments to function ‘int ps_start_utt(ps_decoder_t*, const char*)’ int result = ps_start_utt(instance->ps); ^ In file included from ../src/Recognizer.h:7:0, from ../src/Recognizer.cpp:2: /usr/include/pocketsphinx/pocketsphinx.h:363:5: note: declared here int ps_start_utt(ps_decoder_t *ps, char const *uttid); ^ ../src/Recognizer.cpp: In static member function ‘static v8::Handle<v8::Value> Recognizer::WriteSync(const v8::Arguments&)’: ../src/Recognizer.cpp:290:52: error: too few arguments to function ‘const char* ps_get_hyp(ps_decoder_t*, int32*, const char**)’ const char* hyp = ps_get_hyp(instance->ps, &score); ^ In file included from ../src/Recognizer.h:7:0, from ../src/Recognizer.cpp:2: /usr/include/pocketsphinx/pocketsphinx.h:449:13: note: declared here char const *ps_get_hyp(ps_decoder_t *ps, int32 *out_best_score, ^ ../src/Recognizer.cpp: In static member function ‘static void Recognizer::AsyncWorker(uv_work_t*)’: ../src/Recognizer.cpp:308:58: error: too few arguments to function ‘const char* ps_get_hyp(ps_decoder_t*, int32*, const char**)’ const char* hyp = ps_get_hyp(data->instance->ps, &score); ^ In file included from ../src/Recognizer.h:7:0, from ../src/Recognizer.cpp:2: /usr/include/pocketsphinx/pocketsphinx.h:449:13: note: declared here char const *ps_get_hyp(ps_decoder_t *ps, int32 *out_best_score, ^ make: *** [Release/obj.target/PocketSphinx/src/Recognizer.o] Error 1 make: Leaving directory/home/lester/homework/speech_recognition/node-pocketsphinx/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12) gyp ERR! System Linux 3.13.0-43-generic gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /home/lester/homework/speech_recognition/node-pocketsphinx gyp ERR! node -v v0.10.32 gyp ERR! node-gyp -v v1.0.3 gyp ERR! not ok

nshmyrev commented 9 years ago

The demo uses latest pocketsphinx. You can checkout it from github.