Giter VIP home page Giter VIP logo

hecomi / node-julius Goto Github PK

View Code? Open in Web Editor NEW
72.0 72.0 11.0 42.8 MB

Node.js module for voice recognition using Julius

Home Page: http://d.hatena.ne.jp/hecomi/20121106/1352201767

JavaScript 0.43% Python 0.25% C 79.15% Perl 0.06% C++ 9.66% Shell 3.17% Makefile 1.44% Lex 0.01% Yacc 0.08% Groff 2.37% CMake 0.16% M4 0.02% Batchfile 0.01% HTML 0.30% Objective-C 0.15% SAS 0.02% CLIPS 0.05% Pascal 0.63% Ada 0.80% Assembly 1.27%
julius node-js voice-recognition

node-julius's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-julius's Issues

[OS X] Starting problem

Hi.

I have the following problem:

#
# Fatal error in ../deps/v8/src/api.cc, line 1248
# Check failed: !value_obj->IsJSReceiver() || value_obj->IsTemplateInfo().
#
Illegal instruction: 4

I'm using the first example from README.md:

var Julius  = require('./julius.js')
  , grammar = new Julius.Grammar()
;

// 音声認識させる言葉を覚えさせる
grammar.add('おはようございます');
grammar.add('こんにちは');
grammar.add('おやすみなさい');

// 登録したキーワードをコンパイルして Julius を実行する
grammar.compile(function(err, result) {
	if (err) throw err

	// Julius インスタンスの生成
	var julius = new Julius( grammar.getJconf() );

	// 認識結果のコールバックを追加
	julius.on('result', function(str) {
		console.log(str);
	});

	// 認識の開始
	julius.start();
});

OS X High Sierra.
I didn't have problems with building (I installed gcc, PortAudio, Boost and MeCad successfully using Homebrew).

How can I fix the problem?

Thanks.

Compile errors

Hi, I'm not sure if you know english -- but I wanted to try your library, and having trouble compiling it.

On Ubuntu Linux, after "make" it results in:

node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn python
gyp info spawn args [ '/home/dstein/node-v0.8.7-linux-x64/lib/node_modules/node-gyp/gyp/gyp',
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/dstein/node_modules/julius/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/dstein/node-v0.8.7-linux-x64/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/dstein/.node-gyp/0.8.7/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/dstein/.node-gyp/0.8.7',
gyp info spawn args '-Dmodule_root_dir=/home/dstein/node_modules/julius',
gyp info spawn args '--depth=.',
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[1]: Entering directory /home/dstein/node_modules/julius/build' CXX(target) Release/obj.target/julius/src/julius.o In file included from ../src/julius.cpp:4:0: ../src/julius.hpp:99:60: error: ‘nullptr’ was not declared in this scope ../src/julius.cpp: In static member function ‘static v8::Handle<v8::Value> Julius::Start(const v8::Arguments&)’: ../src/julius.cpp:68:39: error: ‘nullptr’ was not declared in this scope ../src/julius.cpp: In constructor ‘Julius::Julius(const std::string&)’: ../src/julius.cpp:161:10: error: ‘nullptr’ was not declared in this scope ../src/julius.cpp: In member function ‘void Julius::make_recog(const std::string&)’: ../src/julius.cpp:192:15: error: ‘nullptr’ was not declared in this scope ../src/julius.cpp:199:16: error: ‘nullptr’ was not declared in this scope ../src/julius.cpp: In member function ‘void Julius::free_recog()’: ../src/julius.cpp:217:16: error: ‘nullptr’ was not declared in this scope ../src/julius.cpp:224:18: error: ‘nullptr’ was not declared in this scope ../src/julius.cpp: In member function ‘void Julius::on_result(Recog*)’: ../src/julius.cpp:276:26: error: ‘nullptr’ was not declared in this scope make[1]: *** [Release/obj.target/julius/src/julius.o] Error 1 make[1]: Leaving directory/home/dstein/node_modules/julius/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/dstein/node-v0.8.7-linux-x64/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Linux 2.6.38-8-generic
gyp ERR! command "node" "/home/dstein/node/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/dstein/node_modules/julius
gyp ERR! node -v v0.8.7
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
make: *** [all] Error 1

npm install でのインストール時のエラー

npm install でのインストール時に下記の

npm ERR! [email protected] install: make
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the julius package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make
npm ERR! You can get their info via:
npm ERR! npm owner ls julius
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 14.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/s.tachibana/Dropbox/drone/ardrone-voice
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm http GET https://registry.npmjs.org/uuid-v4
npm http 304 https://registry.npmjs.org/uuid-v4

考えられる原因はありますでしょうか?
必要なパッケージなどがあればご教示いただけないでしょうか?

*** invalid %N$ use detected ***

npm install -S juliusでインストールしようとしたのですが、下記のエラーがでて止まってしまいます。
git cloneで落としたあとmakeでやってみても同じです。どうしたらコンパイルできるでしょうか。

環境:
Ubuntu 16.04 (x64)
node 4.5.0(バージョン変えてやってみましたが変わりませんでした)
node-gyp 3.4.0
npm 2.15.9

node-gyp rebuild
make[1]: ディレクトリ '/home/coorde/bot/node_modules/julius/build' に入ります
  CXX(target) Release/obj.target/julius/src/julius.o
  SOLINK_MODULE(target) Release/obj.target/julius.node
*** invalid %N$ use detected ***
collect2: fatal error: ld terminated with signal 6 [中止], core dumped
compilation terminated.
/usr/bin/ld: julius.target.mk:138: ターゲット 'Release/obj.target/julius.node' のレシピで失敗しました
make[1]: *** [Release/obj.target/julius.node] エラー 1
make[1]: ディレクトリ '/home/coorde/bot/node_modules/julius/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/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-36-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/coorde/bot/node_modules/julius
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
Makefile:7: ターゲット 'all' のレシピで失敗しました
make: *** [all] エラー 1
npm ERR! Linux 4.4.0-36-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-S" "julius"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `make`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] install script 'make'.
npm ERR! This is most likely a problem with the julius package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls julius
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/coorde/bot/npm-debug.log

よろしくお願いします。

Install errors (mictype)

Hi,

I'm trying to install and use node-julius but having install errors. I'm using OSX 10.8.5 and gcc 4.7.3, and I installed boost and mecab through macports. My install process looks like this:

andhall node-julius> git clone https://github.com/hecomi/node-julius
...
andhall node-julius> cd node-julius
andhall node-julius> make
cd julius-4.2.2 && ./configure --with-mictype=portaudio && make
creating cache ./config.cache
checking host system type... i686-apple-darwin
checking host specific optimization flag... no
...
checking for esd.h... no
checking for pa_simple_new in -lpulse-simple... no
checking for Pa_Initialize in -lportaudio... no
configure: error: mictype not supported, or specified type not exist
configure: error: ./configure failed for libsent
make: *** [all] Error 1

If I go into node-julius/julius-4.2.2/ and run ./configure then everything seems to work as expected, and the output shows it having found coreaudio.

Do you know what the problem might be?
Thanks!

npm installできない

環境は
MacOSX: 10.8.2
node.js: 0.8.15
gcc: 4.7.2
boostやmecabは各々最新版をhomebrewでインストールしました。

npm installすると

> node-gyp rebuild

  CXX(target) Release/obj.target/mecab/mecab.o
../mecab.cc:41:2: error: unknown type name 'shared_ptr'
        shared_ptr<MeCab::Tagger> getTagger()
        ^
../mecab.cc:41:12: error: expected member name or ';' after declaration specifiers
        shared_ptr<MeCab::Tagger> getTagger()
        ~~~~~~~~~~^
../mecab.cc:237:2: error: unknown type name 'shared_ptr'
        shared_ptr<MeCab::Tagger> tagger_;
        ^
../mecab.cc:237:12: error: expected member name or ';' after declaration specifiers
        shared_ptr<MeCab::Tagger> tagger_;
        ~~~~~~~~~~^
../mecab.cc:105:24: error: no member named 'getTagger' in 'MeCab_parser'
                auto tagger = _this->getTagger();
                              ~~~~~  ^
../mecab.cc:112:22: error: no member named 'getTagger' in 'MeCab_parser'
                auto node = _this->getTagger()->parseToNode( data->str.c_str() );
                            ~~~~~  ^
../mecab.cc:141:3: error: use of undeclared identifier 'unique_ptr'
                unique_ptr<uv_work_t>   preq(req);
                ^
../mecab.cc:141:14: error: unexpected type name 'uv_work_t': expected expression
                unique_ptr<uv_work_t>   preq(req);
                           ^
../mecab.cc:141:27: error: use of undeclared identifier 'preq'
                unique_ptr<uv_work_t>   preq(req);
                                        ^
../mecab.cc:142:3: error: use of undeclared identifier 'unique_ptr'
                unique_ptr<MeCab_baton> pdata(data);
                ^
../mecab.cc:142:14: error: 'MeCab_baton' does not refer to a value
                unique_ptr<MeCab_baton> pdata(data);
                           ^
../mecab.cc:16:8: note: declared here
struct MeCab_baton
       ^
../mecab.cc:142:27: error: use of undeclared identifier 'pdata'
                unique_ptr<MeCab_baton> pdata(data);
                                        ^
../mecab.cc:145:19: error: use of undeclared identifier 'pdata'; did you mean 'data'?
                auto err      = pdata->err;
                                ^~~~~
                                data
../mecab.cc:140:8: note: 'data' declared here
                auto data  = static_cast<MeCab_baton*>( req->data );
                     ^
../mecab.cc:146:19: error: use of undeclared identifier 'pdata'; did you mean 'data'?
                auto callback = pdata->callback;
                                ^~~~~
                                data
../mecab.cc:140:8: note: 'data' declared here
                auto data  = static_cast<MeCab_baton*>( req->data );
                     ^
../mecab.cc:155:21: error: use of undeclared identifier 'pdata'; did you mean 'data'?
                auto result_vec = pdata->result;
                                  ^~~~~
                                  data
../mecab.cc:140:8: note: 'data' declared here
                auto data  = static_cast<MeCab_baton*>( req->data );
                     ^
../mecab.cc:186:24: error: no member named 'getTagger' in 'MeCab_parser'
                auto tagger = _this->getTagger();
                              ~~~~~  ^
16 errors generated.
make: *** [Release/obj.target/mecab/mecab.o] Error 1

と、mecab-asyncのinstallに失敗しているようです。ひと通り調べてみたのですが、原因が特定できなかったのでよろしくお願いします。

サンプルコードが動作しない

Julius = require "julius"

grammar = new Julius.Grammar()
grammar.add "テスト"

grammar.compile (err, res)->
    if err
        console.log err
    julius = new Julius grammar.getJconf()

    julius.on "result", (str)->
        console.log str

    julius.start()

のようなコードを動作させてみたところ

julius/JuliusGrammar.js:472
    var result = mecab.parseSync( this.toString() )
                       ^
TypeError: [MeCab] Error!: /SourceCache/MeCab/MeCab-359.50/src/tagger.cpp(115) [load_dictionary_resource(param)] /SourceCache/MeCab/MeCab-359.50/src/param.cpp(71) [ifs] no such file or directory: ./dicrc

というエラーが出ました。ちなみにMecabは0.994を使っています。

グラマー登録中のエラーについて

お世話になります。

私の環境は

OS Ubuntu 32
Node 0.10.24
で VMware Player上で動かしています。
辞書は
sudo apt-get install mecab-ipadic-utf8
で文字コードにあわせた状態です。

mecabを実行すると
ほげほげ
ほ 動詞,自立,,,五段・ラ行,体言接続特殊2,ほる,ホ,ホ
げ 名詞,接尾,一般,,,,げ,ゲ,ゲ
ほ 動詞,自立,
,,五段・ラ行,体言接続特殊2,ほる,ホ,ホ
げ 名詞,接尾,一般,
,,,げ,ゲ,ゲ
EOS

と表示されました。

サンプルを実行したところエラーが出ました
t.jsという名でサンプルを書いたところ

$ $ node t
tmp.jconf
STAT: include config: tmp.jconf
STAT: jconf successfully finalized
STAT: *** loading AM00 _default
Stat: init_phmm: Reading in HMM definition
Stat: read_binhmm: binary format HMM definition
Stat: read_binhmm: this HMM does not need multipath handling
Stat: init_phmm: defined HMMs: 43
Stat: init_phmm: logical names: 43
Stat: init_phmm: base phones: 43 used in logical
Stat: init_phmm: finished reading HMM definitions
STAT: *** AM00 _default loaded
STAT: *** loading LM00 _default
STAT: reading [tmp.dfa] and [tmp.dict]...
Error: voca_load_htkdict: line 5: phone "iワ" not found
Error: voca_load_htkdict: the line content was: 4 [こんにちは] k o N n i ch iワ
Error: voca_load_htkdict: begin missing phones
Error: voca_load_htkdict: iワ
Error: voca_load_htkdict: end missing phones
Error: init_voca: error in reading tmp.dict: 1 words failed out of 5 words
ERROR: failed to read dictionary "tmp.dict"
ERROR: m_fusion: some error occured in reading grammars
ERROR: j_create_instance_from_jconf: error in loading model
Segmentation fault (コアダンプ)

と表示されました。

$ more tmp.dict
0 [] silB
1 [] silE
2 [] sp
3 [おはようございます] o h a y o: g o z a i m a s u
4 [こんにちは] k o N n i ch iワ
5 [おやすみなさい] o y a s u m i n a s a i

エラー表示からすると「iワ」が原因だと思うのですが

ソースコードでgrep iワと調べてもJuliusGrammar.jsからは表示されません。
tmp.dictを作るときのロジックを調べるとすぐわかるような気がするのですが何かアドバイスをいただけると幸いです。

あと、基本的な使い方としては音声はマイクをubuntuにつなげるといいのでしょうか?
ブラウザーを通してできる方法とかあるのでしょうか?
お忙しいところ恐縮ですがよろしくお願いします。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.