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

SentenceAlignresult_align_new ()
 allocate storage of recognition alignment results.
void result_align_free (SentenceAlign *a)
 free storage of recognition alignment results.
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.
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.
int j_close_stream (Recog *recog)
 Close 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.11

Definition in file recogmain.c.


Function Documentation

SentenceAlign* result_align_new (  ) 

allocate storage of recognition alignment results.

Returns:
the new pointer

Definition at line 210 of file recogmain.c.

Referenced by do_alignment_all().

Here is the caller graph for this function:

void result_align_free ( SentenceAlign a  ) 

free storage of recognition alignment results.

Parameters:
a [i/o] alignment data to be released

Definition at line 242 of file recogmain.c.

Referenced by result_sentence_free().

Here is the caller graph for this function:

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 270 of file recogmain.c.

Referenced by j_recognize_stream_core().

Here is the caller graph for this function:

void result_sentence_free ( RecogProcess r  ) 

Free storage of recognition results.

Parameters:
r [i/o] recognition process instance

Definition at line 292 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 324 of file recogmain.c.

Referenced by j_recognize_stream_core().

Here is the caller graph for this function:

int adin_cut_callback_store_buffer ( SP16 now,
int  len,
Recog recog 
)

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 385 of file recogmain.c.

Referenced by j_recognize_stream_core(), and RealTimePipeLine().

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 443 of file recogmain.c.

Referenced by j_recognize_stream_core().

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 614 of file recogmain.c.

Referenced by j_recognize_stream_core().

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 674 of file recogmain.c.

Referenced by j_recognize_stream().


Generated on Thu Jul 23 12:14:08 2009 for Julius by  doxygen 1.5.1