LoginSignup
1
1

More than 3 years have passed since last update.

raspberryPiでjulius(音声認識)を使用する。②インストール編

Last updated at Posted at 2020-10-06

関連記事

raspberryPiとjulus(音声認識)を使用する。①マイク編
raspberryPiでjulius(音声認識)を使用する。②インストール編
raspberryPiとJulius(音声認識)を使用する。③辞書作成編
raspberryPiとJulius(音声認識)を使用する。④Lチカ編
raspberryPiとJulius(音声認識)を使用する。⑤i2cキャラクタディスプレイ編

沢山の人がJuliusを使って記事にまとめているが、ハマりにハマって何本も読む羽目になったので統合する目的で備忘録として残していく。
皆さん順当にできていてすごい。

使用するもの

raspberryPi 3B+
USBマイク(サンワサプライ USBマイクロホン 単一指向性 直挿し型 MM-MCU02BK)

Juliusをインストールする


juliusをインストールする
$ wget https://github.com/julius-speech/julius/archive/v4.6.tar.gz

解凍する

$ tar zxvf julius-4.6.tar.gz

コンパイルとインストールをする(2行目大事、ハマった)

$ cd julius-4.6
$ ./configure --with-mictype=alsa
$ make
$ sudo make install

juliusを動かそうとした段階でハマった時のエラーはこれ

Stat: adin_oss: device name = /dev/dsp (application default)
Error: adin_oss: failed to open /dev/dsp
failed to begin input stream

これで解決するよーってのもエラーでダメ。それがこれ。

$sudo modprobe snd-pcm-oss
modprobe: FATAL: Module snd-pcm-oss not found in directory /lib/modules/4.14.34-v7+

./configureはjulius-4.6のディレクトリの中にあるのでそこに移動してから、実行すればハマらないはず。
ダウングレードする必要はなかった。
最初から上手くダウンロード解凍できたら最高。

バージョンの確認

 $ julius -version

image.png
こんな感じならOK。

juliusパッケージのインストール

キット類はフォルダに入れている人が多いので適当に名前を付けてその中でダウンロード解凍するといいと思う。

$ cd julius-4.6
$ mk julius-kit
$ cd julius-kit

階層イメージはこう。階層作りすぎても面倒。
数字の前にvが付いていないので引っかからないように…。

~/julius
    |--julius-4.6
          |--julius-kit
                |--dictation-kit-4.5
                |--grammer-kit-4.3.1

dictationキットのインストール

$ wget https://osdn.net/dl/julius/dictation-kit-4.5.zip
$ unzip dictation-kit-v4.4.zip

grammerキットのインストール

$ wget https://osdn.net/dl/julius/grammer-kit-4.3.1zip
$ unzip grammer-kit-4.3.1.zip

動かしてみる

自分のフォルダの階層はこうなっている。

~/julius
    |--julius-4.6
          |--julius-kit
                |--dictation-kit-4.5
                |--grammer-kit-4.3.1

次の実行コードは自分のフォルダ階層に合わせて書き換えてください。

$ julius -C ~/julius/julius-4.6/julius-kit/dictation-kit-4.5/main.jconf -C ~/julius/julius-4.6/julius-kit/dictation-kit-4.5/am-gmm.jconf -nostrip

image.png
めちゃめちゃ長い文字の後にplease speakと出て、
image.png
精度はともかく何か反応があれば成功。
image.png
ctrl+Cで終了する。

マイク編で書いたけれど、snd-pcm-ossは3B+には入っていなくて次のコードを打っても

$ sudo modprobe snd-pcm-oss

エラーが出るので、ALSAモジュールをインストールしてALSAを使うように設定してください。

Juliusのインストール完了

次は独自辞書を作る。
raspberryPiとJulius(音声認識)を使用する。③辞書作成編

参考
ラズパイ3日目②:Raspberry Pi+Juliusで音声を認識
Raspberry pi3B+でjuliusを動かせるようになるまでの覚書き(2019.3.10現在)
raspi最新カーネルでjuliusを動かす

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1