libjulius/src/recogmain.c File Reference

Main function of recognition process. More...

#include <julius/julius.h>
#include <signal.h>

Go to the source code of this file.

Defines

#define GLOBAL_VARIABLE_DEFINE
 Actually make global vars in global.h.

Functions

void result_sentence_malloc (RecogProcess *r, int num)
 Allocate storage of recognition results.
void result_sentence_free (RecogProcess *r)
 Free storage of recognition results.
void clear_result (RecogProcess *r)
 Clear all result storages for next input.
static int adin_cut_callback_store_buffer (SP16 *now, int len, Recog *recog)
 adin_go() callback to score triggered inputs to buffer.
static int callback_check_in_adin (Recog *recog)
 callback function periodically called while input.
int j_open_stream (Recog *recog, char *file_or_dev_name)
 Open input stream.
static void result_error (Recog *recog, int status)
 Recognition error handling.
static int j_recognize_stream_core (Recog *recog)
 Execute recognition.
int j_recognize_stream (Recog *recog)
 Recognize an input stream.


Detailed Description

Main function of recognition process.

Author:
Akinobu Lee
Date:
Wed Aug 8 14:53:53 2007
Revision
1.1.1.1

Definition in file recogmain.c.


Function Documentation

void result_sentence_malloc ( RecogProcess r,
int  num 
)

Allocate storage of recognition results.

Parameters:
r [out] recognition process instance
num [in] number of sentences to be output

Definition at line 208 of file recogmain.c.

void result_sentence_free ( RecogProcess r  ) 

Free storage of recognition results.

Parameters:
r [i/o] recognition process instance

Definition at line 239 of file recogmain.c.

Referenced by clear_result().

Here is the caller graph for this function:

void clear_result ( RecogProcess r  ) 

Clear all result storages for next input.

Parameters:
r [in] recognition process instance.

Definition at line 271 of file recogmain.c.

static int adin_cut_callback_store_buffer ( SP16 now,
int  len,
Recog recog 
) [static]

adin_go() callback to score triggered inputs to buffer.

This function records the incomping speech segments detected in adin_go() to recog->speech. This function will be used when recognition runs in buffered mode (= non-realtime mode).

Parameters:
now [in] input speech samples.
len [in] length of now in samples
recog [i/o] engine instance
Returns:
-1 on error (tell adin_go() to terminate), 0 on success (tell adin_go() to continue recording), or 1 when this function requires input segmentation.

Definition at line 332 of file recogmain.c.

static int callback_check_in_adin ( Recog recog  )  [static]

callback function periodically called while input.

This function will be called periodically from adin_go() while waiting input or processing recognition. It will call user-defined callback registered in CALLBACK_POLL, check for the process status and issue recognition termination request.

Parameters:
recog [in] engine instance
Returns:
0 normally, -2 for immediate termination, and -1 if requesting recognition stop.

Definition at line 390 of file recogmain.c.

static void result_error ( Recog recog,
int  status 
) [static]

Recognition error handling.

Parameters:
recog [in] engine instance
status [in] error status to be set

Definition at line 503 of file recogmain.c.

static int j_recognize_stream_core ( Recog recog  )  [static]

Execute recognition.

This function repeats recognition sequences until the input stream reached its end. It detects speech segment (if needed), recognize the detected segment, output result, and go back to the first.

This function will be stopped and exited if reached end of stream (mostly in case of file input), some error has been occured, or termination requested from application by calling j_request_pause() and j_request_terminate().

Parameters:
recog [i/o] engine instance
Returns:
1 when stopped by application request, 0 when reached end of stream, or -1 when an error occured. Note that the input stream can still continues when 1 is returned.

Definition at line 560 of file recogmain.c.


Generated on Tue Dec 18 16:01:24 2007 for Julius by  doxygen 1.5.4