julius/module.c

モジュールモード(サーバーモード)時のメインループ [詳細]

#include <julius.h>
#include <stdarg.h>
module.cのインクルード依存関係図

ソースコードを見る。

マクロ定義

#define MAXBUFLEN   4096
 Maximum line length of a message sent from a client.

関数

void main_module_loop ()
 モジュールモード時のアプリケーションメインループ.
boolean module_disconnect ()
boolean module_is_connected ()
void msock_exec_command (char *command)
 モジュールコマンドを処理する.
boolean module_is_active ()
 認識処理の実行可能/実行停止状態を返す.
boolean module_wants_terminate ()
 現在音声認識の即時停止要求があるかどうかを返す.
void module_reset_reload ()
void msock_process_command ()
void msock_check_and_process_command ()
int msock_check_in_adin ()
 音声入力待ち中のモジュールコマンド処理のためのコールバック関数. 音声入力待ち中にクライアントモジュールから送られたコマンドを 処理するためのコールバック関数.音声入力処理中に定期的に呼ばれる. もしコマンドがある場合それを処理する.また,即時の認識中断(入力破棄)や 入力の中止を求められている場合はそのようにステータスを音声入力処理関数に 返す.

変数

static int listen_sd = -1
 Socket to listen to a client.
static char mbuf [MAXBUFLEN]
 Work buffer for message output.
static boolean process_active = TRUE
static boolean process_want_terminate = FALSE
static boolean process_want_reload = FALSE

説明

モジュールモード(サーバーモード)時のメインループ

作者:
Akinobu Lee
日付:
Mon May 30 15:59:54 2005
Revision
1.5

module.c で定義されています。


関数

void main_module_loop (  ) 

モジュールモード時のアプリケーションメインループ.

クライアントプロセスからの接続要求を待ち,要求が来たらソケットを開いて 認識のメインループを呼ぶ.接続したソケットデスクプリタは帯域変数 module_sd に記録される.なお Win32 ではフォークしない.

module.c89 行で定義されています。

参照元 main().

boolean module_disconnect (  ) 

現在接続中のクライアントとの接続を切断する.

戻り値:
成功時 TRUE, 失敗時 FALSE を返す.

module.c152 行で定義されています。

参照元 m_errexit(), m_exit(), と msock_exec_command().

boolean module_is_connected (  ) 

現在クライアントと接続中かどうかを返す

戻り値:
接続中の場合 TRUE, 未接続の場合 FALSEを返す.

module.c172 行で定義されています。

参照元 m_errexit(), m_exit(), と msock_check_in_adin().

void msock_exec_command ( char *  command  ) 

モジュールコマンドを処理する.

クライアントより与えられたコマンドを処理する.この関数はクライアントから コマンドが送られてくるたびに音声認識処理に割り込んで呼ばれる. ステータス等についてはここですぐに応答メッセージを送るが, 文法の追加や削除などは,ここでは受信のみ行い,実際の変更処理 (各文法からのグローバル文法の再構築など)は認識処理の合間に実行される. この文法再構築処理を実際に行うのは multigram_exec() である.

引数:
command [in] コマンド文字列

module.c326 行で定義されています。

参照元 main_recognition_loop(), msock_check_and_process_command(), と msock_process_command().

boolean module_is_active (  ) 

認識処理の実行可能/実行停止状態を返す.

プロセスが実行可能状態(入力音声のトリガをモニタ中,あるいは現在 音声認識処理を実行中)であれば TRUE を,実行停止状態 (モジュールからのコマンド処理以外の処理を停止しており,入力が あっても無視する)であれば FALSE を返す.

戻り値:
実行可能状態であれば TRUE を,実行停止状態であれば FALSE を返す.

module.c563 行で定義されています。

参照元 adin_cut_callback_store_buffer(), と main_recognition_loop().

boolean module_wants_terminate (  ) 

現在音声認識の即時停止要求があるかどうかを返す.

モジュールコマンド "TERMINATE" や文法変更などで,即時に認識処理を 停止する必要があるかどうかを返す.この関数は音声認識処理の各ループ 内で,即時に停止する必要があるかどうかチェックするために呼ばれる.

戻り値:
即時停止要求があるときに TRUE,ないときに FALSE を返す.

module.c592 行で定義されています。

参照元 adin_cut_callback_store_buffer(), get_back_trellis(), main_recognition_loop(), msock_check_in_adin(), と wchmm_fbs().

void module_reset_reload (  ) 

process_want_reload フラグをクリアする.

module.c608 行で定義されています。

参照元 main_recognition_loop().

void msock_process_command (  ) 

クライアントモジュールからの命令を読み込んで処理する. 命令が無い場合,次のコマンドが来るまで待つ.

module.c626 行で定義されています。

参照元 main_recognition_loop().

void msock_check_and_process_command (  ) 

現在クライアントモジュールからの命令がバッファにあるか調べ, もしあれば処理する.なければそのまま終了する.

module.c652 行で定義されています。

参照元 adin_cut_callback_store_buffer(), main_recognition_loop(), と msock_check_in_adin().

int msock_check_in_adin (  ) 

音声入力待ち中のモジュールコマンド処理のためのコールバック関数. 音声入力待ち中にクライアントモジュールから送られたコマンドを 処理するためのコールバック関数.音声入力処理中に定期的に呼ばれる. もしコマンドがある場合それを処理する.また,即時の認識中断(入力破棄)や 入力の中止を求められている場合はそのようにステータスを音声入力処理関数に 返す.

戻り値:
通常時 0, 即時中断要求がある時は -2, 認識中止要求があるときは -1 を返す.

module.c707 行で定義されています。

参照元 main_recognition_loop().


変数

boolean process_active = TRUE [static]

Status flag indicating whether the recognition is alive or not. If TRUE, the process is currently activated, either monitoring an audio input or recognizing the current input. If FALSE, the recognition is now disabled until some activation command has been arrived from client. While disabled, all the inputs are ignored.

If set to FALSE in the program, Julius/Julian will stop after the current recognition ends, and enter the disabled status.

module.c43 行で定義されています。

参照元 module_is_active(), と msock_exec_command().

boolean process_want_terminate = FALSE [static]

If set to TRUE, Julius/Julian stops recognition immediately, terminating the currenct recognition process, and enter into disabled status.

module.c50 行で定義されています。

参照元 module_wants_terminate(), と msock_exec_command().

boolean process_want_reload = FALSE [static]

If set to TRUE, Julius/Julian stops recognition softly. If it is performing recognition of the 1st pass, it immediately segments the current input, process the 2nd pass, and output the result. Then it enters the disabled status.

module.c59 行で定義されています。

参照元 module_reset_reload(), msock_check_in_adin(), と msock_exec_command().


Juliusに対してTue Sep 22 00:14:17 2009に生成されました。  doxygen 1.6.0