plugin/fvin.c

説明を見る。
00001 
00046 #include <stdio.h>
00047 #include <string.h>
00048 #include "plugin_defs.h"
00049 
00050 #define PLUGIN_TITLE "Feature vector input plugin for Julius"
00051 #define INPUT_OPT "myfvin"
00052 
00053 /************************************************************************/
00054 
00077 int
00078 initialize()
00079 {
00080   return 0;
00081 }
00082 
00119 int
00120 get_plugin_info(int opcode, char *buf, int buflen)
00121 {
00122   switch(opcode) {
00123   case 0:
00124     /* plugin description string */
00125     strncpy(buf, PLUGIN_TITLE, buflen);
00126     break;
00127   }
00128 
00129   return 0;
00130 }
00131 
00132 /************************************************************************/
00133 /************************************************************************/
00134 /* Feature-vector input plugin functions */
00135 
00164 void
00165 fvin_get_optname(char *buf, int buflen)
00166 {
00167   strncpy(buf, INPUT_OPT, buflen);
00168 }
00169 
00211 int
00212 fvin_get_configuration(int opcode)
00213 {
00214   switch(opcode) {
00215   case 0:                  /* return number of elements in a vector */
00216     return(25);
00217   case 1:/* return msec per frame */
00218     return(10);
00219   case 2:/* return parameter type specification in HTK format */
00220     /* return 0xffff to disable checking */
00221     return(0xffff);
00222   }
00223 }
00224 
00225 /************************************************************************/
00226 
00253 boolean
00254 fvin_standby()
00255 {
00256 
00257   /* sever socket ready etc... */
00258   return TRUE;
00259 
00260 }
00261 
00288 boolean
00289 fvin_open()
00290 {
00291   /* listen and accept socket, or open a file */
00292   return TRUE;
00293 }
00294 
00345 int
00346 fvin_read(float *vecbuf, int veclen)
00347 {
00348   /* read one vector from the input */
00349   if (0/* error */) return ADIN_ERROR;
00350   if (0/* input should be segmented here */) return ADIN_SEGMENT;
00351   if (0/* EOF */) return ADIN_ERROR;
00352 
00353   return(0);                    /* success */
00354 }
00355 
00389 boolean
00390 fvin_close()
00391 {
00392   /* file close, connection close, etc.. */
00393   return TRUE;
00394 }
00395 
00396 /************************************************************************/
00397 
00442 boolean
00443 fvin_terminate()
00444 {
00445   printf("terminate request\n");
00446   return TRUE;
00447 }
00448 
00498 boolean
00499 fvin_pause()
00500 {
00501   printf("pause request\n");
00502   return TRUE;
00503 }
00504 
00545 boolean
00546 fvin_resume()
00547 {
00548   printf("resume request\n");
00549   return TRUE;
00550 }
00551 
00552 /* end of file */

Juliusに対してThu Jul 23 12:16:23 2009に生成されました。  doxygen 1.5.1