日本語連続音声認識エンジン"Julius"をAndroidで動作させるの連載2回目です。Androidでオフライン音声認識を行うアプリに着々と近づいています。 今回は、 前回 生成したAndroidARM系CPU用Juliusライブラリと、AndroidのJavaアプリとをつなぐJNIコードを紹介します。 残念なことに、今回も一筋縄ではいきません。Juliusをライブラリとして利用する手順が複雑なため、Javaのnativeメソッド経由でJuliusライブラリを呼び出す"フツーのJNI"だけでなく、Juliusライブラリからコールバック関数経由でJavaメソッドが呼び出されるという逆方向の処理が必要なためです。 さて、覚悟も決まったところで、コードの世界に飛び込みましょう。 動作するソースコードは、 githubの Julius for Android を参照してください。 Juliu