int32 main(int32 argc, char *argv[]) { kb_t kb; stat_t *st; cmd_ln_t *config; print_appl_info(argv[0]); cmd_ln_appl_enter(argc, argv, "default.arg", arg); unlimit(); config = cmd_ln_get(); kb_init(&kb, config); st = kb.stat; fprintf(stdout, "\n"); if (cmd_ln_str_r(config, "-ctl")) { /* When -ctlfile is speicified, corpus.c will look at -ctl_lm and -ctl_mllr to get the corresponding LM and MLLR for the utterance */ st->tm = ctl_process(cmd_ln_str_r(config, "-ctl"), cmd_ln_str_r(config, "-ctl_lm"), cmd_ln_str_r(config, "-ctl_mllr"), cmd_ln_int32_r(config, "-ctloffset"), cmd_ln_int32_r(config, "-ctlcount"), utt_decode, &kb); } else if (cmd_ln_str_r(config, "-utt")) { /* When -utt is specified, corpus.c will wait for the utterance to change */ st->tm = ctl_process_utt(cmd_ln_str_r(config, "-utt"), cmd_ln_int32_r(config, "-ctlcount"), utt_decode, &kb); } else { /* Is error checking good enough?" */ E_FATAL("Both -utt and -ctl are not specified.\n"); } if (kb.matchsegfp) fclose(kb.matchsegfp); if (kb.matchfp) fclose(kb.matchfp); stat_report_corpus(kb.stat); kb_free(&kb); #if (! WIN32) #if defined(_SUN4) system("ps -el | grep sphinx3_decode"); #else system("ps aguxwww | grep sphinx3_decode"); #endif #endif cmd_ln_free_r(config); exit(0); }
int main(int _argc, char **_argv) { char *ctrlfn; char *cfgfn; cmd_ln_t *config = NULL; print_appl_info(_argv[0]); if (_argc != 4) { printf("\nUSAGE: %s <ctrlfile> <rawdir> <cfgfile>\n", _argv[0]); return -1; } ctrlfn = _argv[1]; rawdirfn = _argv[2]; cfgfn = _argv[3]; if ((config = cmd_ln_parse_file_r(config, S3_DECODE_ARG_DEFS, cfgfn, TRUE)) == NULL) E_FATAL("Bad configuration file %s.\n", cfgfn); if (s3_decode_init(&decoder, config) != S3_DECODE_SUCCESS) E_FATAL("Failed to initialize live-decoder.\n"); fe = fe_init_auto_r(config); st = decoder.kb.stat; ptmr_init(&(st->tm)); if (ctrlfn) { /* When -ctlfile is speicified, corpus.c will look at -ctl_lm and -ctl_mllr to get the corresponding LM and MLLR for the utterance */ st->tm = ctl_process(ctrlfn, cmd_ln_str_r(config, "-ctl_lm"), cmd_ln_str_r(config, "-ctl_mllr"), cmd_ln_int32_r(config, "-ctloffset"), cmd_ln_int32_r(config, "-ctlcount"), utt_livepretend, &(decoder.kb)); } else { E_FATAL("control file is not specified.\n"); } stat_report_corpus(decoder.kb.stat); s3_decode_close(&decoder); fe_free(fe); return 0; }