plugin/generic_callback.c File Reference

An example plugin using callback. More...

#include <julius/juliuslib.h>

Go to the source code of this file.

Defines

#define PLUGIN_TITLE   "An example plugin using callback"
 using plugin function:

Functions

int initialize ()
 Initialization at loading time (optional).
int get_plugin_info (int opcode, char *buf, int buflen)
 Get information of this plugin (required).
static void status_recready (Recog *recog, void *dummy)
 A sample callback function to output RECREADY message.
int startup (void *data)
 plugin function that will be called after engine startup.


Detailed Description

An example plugin using callback.

Author:
Akinobu Lee
Date:
Wed Aug 13 23:50:27 2008
Revision
1.1

Definition in file generic_callback.c.


Define Documentation

#define PLUGIN_TITLE   "An example plugin using callback"

using plugin function:

Definition at line 38 of file generic_callback.c.


Function Documentation

int initialize (  ) 

Initialization at loading time (optional).

If defined, this will be called just before this plugin is loaded to Julius. if this returns -1, the whole functions in this file will not be loaded.

This function is OPTIONAL.

Returns:
0 on success, -1 on failure.

Definition at line 63 of file generic_callback.c.

int get_plugin_info ( int  opcode,
char *  buf,
int  buflen 
)

Get information of this plugin (required).

This function should return informations of this plugin file. The required info will be specified by opcode:

This will be called just after Julius find this file and after initialize().

Parameters:
opcode [in] requested operation code
buf [out] buffer to store the return string
buflen [in] maximum length of buf
Returns:
0 on success, -1 on failure. On failure, Julius will ignore this plugin.

Definition at line 105 of file generic_callback.c.

static void status_recready ( Recog recog,
void *  dummy 
) [static]

A sample callback function to output RECREADY message.

Parameters:
recog [in] engine instance
dummy [in] callback argument (dummy)

Definition at line 133 of file generic_callback.c.

int startup ( void *  data  ) 

plugin function that will be called after engine startup.

When the function of this name is defined in a plugin, this will be called just after Julius finished all startup sequence and before input and recognition start.

In this example, this function registers the local function status_recready() as a CALLBACK_EVENT_SPEECH_READY callback. This callback will be called on every time Julius is ready for recognition for the next incoming input.

Parameters:
data [in] a data pointer, actually a pointer to an engine instance.
Returns:
0 on success, -1 on error. On error, Julius will exit immediately.

Definition at line 175 of file generic_callback.c.


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