From sumomo ¡÷ users.sourceforge.jp Mon Oct 1 13:23:21 2012 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Mon, 01 Oct 2012 13:23:21 +0900 Subject: [Julius-cvs 788] CVS update: julius4/libjulius/src Message-ID: <1349065401.469864.17739.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/realtime-1stpass.c diff -u julius4/libjulius/src/realtime-1stpass.c:1.9 julius4/libjulius/src/realtime-1stpass.c:1.10 --- julius4/libjulius/src/realtime-1stpass.c:1.9 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/realtime-1stpass.c Mon Oct 1 13:23:21 2012 @@ -111,7 +111,7 @@ * @author Akinobu Lee * @date Tue Aug 23 11:44:14 2005 * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * */ /* @@ -1161,6 +1161,12 @@ /* loop until all data has been flushed */ while (1) { + /* check frame overflow */ + for (mfcc = recog->mfcclist; mfcc; mfcc = mfcc->next) { + if (! mfcc->valid) continue; + if (mfcc->f >= r->maxframelen) mfcc->valid = FALSE; + } + /* if all mfcc became invalid, exit loop here */ ok_p = FALSE; for (mfcc = recog->mfcclist; mfcc; mfcc = mfcc->next) { @@ -1321,7 +1327,6 @@ for (mfcc = recog->mfcclist; mfcc; mfcc = mfcc->next) { if (! mfcc->valid) continue; mfcc->f++; - if (mfcc->f > r->maxframelen) mfcc->valid = FALSE; } } From sumomo ¡÷ users.sourceforge.jp Tue Oct 9 20:25:21 2012 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 09 Oct 2012 20:25:21 +0900 Subject: [Julius-cvs 789] CVS update: julius4/libjulius/include/julius Message-ID: <1349781921.447059.9182.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/include/julius/extern.h diff -u julius4/libjulius/include/julius/extern.h:1.19 julius4/libjulius/include/julius/extern.h:1.20 --- julius4/libjulius/include/julius/extern.h:1.19 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/include/julius/extern.h Tue Oct 9 20:25:21 2012 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Mon Mar 7 23:19:14 2005 * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * */ /* @@ -191,6 +191,7 @@ boolean j_launch_recognition_instance(Recog *recog, JCONF_SEARCH *sconf); boolean j_final_fusion(Recog *recog); void create_mfcc_calc_instances(Recog *recog); +boolean j_reload_adddict(Recog *recog, PROCESS_LM *lm); /* hmm_check.c */ void hmm_check(RecogProcess *r); From sumomo ¡÷ users.sourceforge.jp Tue Oct 9 20:25:21 2012 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 09 Oct 2012 20:25:21 +0900 Subject: [Julius-cvs 790] CVS update: julius4/libjulius/src Message-ID: <1349781921.527000.9191.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/m_fusion.c diff -u julius4/libjulius/src/m_fusion.c:1.22 julius4/libjulius/src/m_fusion.c:1.23 --- julius4/libjulius/src/m_fusion.c:1.22 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/m_fusion.c Tue Oct 9 20:25:21 2012 @@ -20,7 +20,7 @@ * @author Akinobu Lee * @date Thu May 12 13:31:47 2005 * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * */ /* @@ -1380,4 +1380,102 @@ return TRUE; } +/** + * + * @brief Reload dictionaries. + * + * This function reload dictionaries from file. + * + * This function works only for N-gram LM. + * It also re-create all the recognition process, even if it is grammar-based. + * + * @param recog [i/o] engine instance + * @param lm [i/o] LM instance to reload + * + * @return TRUE on success, or FALSE on error. + * + */ +boolean +j_reload_adddict(Recog *recog, PROCESS_LM *lm) +{ + RecogProcess *p, *ptmp; + JCONF_SEARCH *sh; + PROCESS_AM *am, *atmp; + + jlog("STAT: *** reloading (additional) dictionary of LM%02d %s\n", lm->config->id, lm->config->name); + + /* free current dictionary */ + if (lm->winfo) word_info_free(lm->winfo); + if (lm->grammars) multigram_free_all(lm->grammars); + if (lm->dfa) dfa_info_free(lm->dfa); + + /* free all current process instanfces */ + p = recog->process_list; + while(p) { + ptmp = p->next; + j_recogprocess_free(p); + p = ptmp; + } + recog->process_list = NULL; + + /* reload dictionary */ + if (lm->lmtype == LM_PROB) { + + if ((lm->winfo = initialize_dict(lm->config, lm->am->hmminfo)) == NULL) { + jlog("ERROR: m_fusion: failed to reload dictionary\n"); + return FALSE; + } + if (lm->config->ngram_filename_lr_arpa || lm->config->ngram_filename_rl_arpa || lm->config->ngram_filename) { + /* re-map dict item to N-gram entry */ + if (make_voca_ref(lm->ngram, lm->winfo) == FALSE) { + jlog("ERROR: m_fusion: failed to map words in additional dictionary to N-gram\n"); + return FALSE; + } +#if 0 + /* post-fix EOS / BOS uni prob for SRILM */ + fix_uniprob_srilm(ngram, winfo); +#endif + } + } + +#if 0 + /* grammar case: not tested */ + if (lm->lmtype == LM_DFA) { + if (lm->config->dfa_filename != NULL && lm->config->dictfilename != NULL) { + /* here add grammar specified by "-dfa" and "-v" to grammar list */ + multigram_add_gramlist(lm->config->dfa_filename, lm->config->dictfilename, lm->config, LM_DFA_GRAMMAR); + } + /* load all the specified grammars */ + if (multigram_load_all_gramlist(lm) == FALSE) { + jlog("ERROR: m_fusion: some error occured in reading grammars\n"); + return FALSE; + } + /* setup for later wchmm building */ + multigram_update(lm); + /* the whole lexicon will be forced to built in the boot sequence, + so reset the global modification flag here */ + lm->global_modified = FALSE; + } +#endif + + /* re-create all recognition process instance */ + for(sh=recog->jconf->search_root;sh;sh=sh->next) { + if (j_launch_recognition_instance(recog, sh) == FALSE) { + jlog("ERROR: m_fusion: failed to re-start recognizer instance \"%s\"\n", sh->name); + return FALSE; + } + } + + /* the created process will be live=FALSE, active = 1, so + the new recognition instance is dead now but + will be made live at next session */ + + /* tell engine to update */ + recog->process_want_reload = TRUE; + + jlog("STAT: *** LM%02d %s additional dictionary reloaded\n", lm->config->id, lm->config->name); + + return TRUE; +} + /* end of file */ From sumomo ¡÷ users.sourceforge.jp Wed Oct 10 11:36:03 2012 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Wed, 10 Oct 2012 11:36:03 +0900 Subject: [Julius-cvs 791] CVS update: julius4/libsent/src/adin Message-ID: <1349836563.405475.17628.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/adin/adin_mic_sol2.c diff -u julius4/libsent/src/adin/adin_mic_sol2.c:1.6 julius4/libsent/src/adin/adin_mic_sol2.c:1.7 --- julius4/libsent/src/adin/adin_mic_sol2.c:1.6 Fri Jul 27 17:44:50 2012 +++ julius4/libsent/src/adin/adin_mic_sol2.c Wed Oct 10 11:36:03 2012 @@ -38,7 +38,7 @@ * @author Akinobu LEE * @date Sun Feb 13 19:06:46 2005 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * */ /* @@ -60,16 +60,15 @@ /* sound header */ #include +/// Default device name, can be overridden by AUDIODEV environment variable +#define DEFAULT_DEVICE "/dev/audio" + static int srate; ///< Required sampling rate static int afd; ///< Audio file descriptor static struct audio_info ainfo; ///< Audio format information static char *defaultdev = DEFAULT_DEVICE; static char devname[MAXPATHLEN]; -/// Default device name, can be overridden by AUDIODEV environment variable -#define DEFAULT_DEVICE "/dev/audio" - - /** * Device initialization: check device capability * From sumomo ¡÷ users.sourceforge.jp Wed Oct 10 11:36:03 2012 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Wed, 10 Oct 2012 11:36:03 +0900 Subject: [Julius-cvs 792] CVS update: julius4/libsent/src/net Message-ID: <1349836563.543509.17671.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/net/rdwt.c diff -u julius4/libsent/src/net/rdwt.c:1.5 julius4/libsent/src/net/rdwt.c:1.6 --- julius4/libsent/src/net/rdwt.c:1.5 Fri Jul 27 17:44:56 2012 +++ julius4/libsent/src/net/rdwt.c Wed Oct 10 11:36:03 2012 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Wed Feb 16 07:09:25 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ /* @@ -61,6 +61,9 @@ toread -= ret; off += ret; } +#ifdef WORDS_BIGENDIAN + swap_bytes((char *)len, sizeof(int), 1); +#endif if (*len > maxlen) { jlog("Error: rdwt: transfer data length exceeded: %d (>%d)\n", len, maxlen); return(-1); @@ -98,6 +101,9 @@ { int tmpbytes; +#ifdef WORDS_BIGENDIAN + swap_bytes((char *)&len, sizeof(int), 1); +#endif /* len == 0 is used to tell end of segment ack */ if ((tmpbytes= #ifdef WINSOCK @@ -109,6 +115,9 @@ /*jlog( "failed to write num\n");*/ return(-1); } +#ifdef WORDS_BIGENDIAN + swap_bytes((char *)&len, sizeof(int), 1); +#endif if (len > 0) { if ((tmpbytes= #ifdef WINSOCK From sumomo ¡÷ users.sourceforge.jp Wed Oct 10 11:47:10 2012 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Wed, 10 Oct 2012 11:47:10 +0900 Subject: [Julius-cvs 793] CVS update: julius4/libjulius/include/julius Message-ID: <1349837230.962123.2293.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/include/julius/jconf.h diff -u julius4/libjulius/include/julius/jconf.h:1.14 julius4/libjulius/include/julius/jconf.h:1.15 --- julius4/libjulius/include/julius/jconf.h:1.14 Sun Aug 5 10:26:54 2012 +++ julius4/libjulius/include/julius/jconf.h Wed Oct 10 11:47:10 2012 @@ -23,7 +23,7 @@ * @author Akinobu Lee * @date Fri Feb 16 13:42:28 2007 * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * */ /* @@ -955,6 +955,11 @@ */ boolean use_zmean; + /** + * Input level scaling factor (-lvscale) + */ + float level_coef; + } preprocess; /** Index: julius4/libjulius/include/julius/jfunc.h diff -u julius4/libjulius/include/julius/jfunc.h:1.10 julius4/libjulius/include/julius/jfunc.h:1.11 --- julius4/libjulius/include/julius/jfunc.h:1.10 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/include/julius/jfunc.h Wed Oct 10 11:47:10 2012 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Tue Nov 6 22:41:00 2007 * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * */ /* @@ -89,6 +89,9 @@ void vtln_alpha(Recog *recog, RecogProcess *r); #endif +void j_adin_change_input_scaling_factor(Recog *recog, float factor); + + /* instance.c */ MFCCCalc *j_mfcccalc_new(JCONF_AM *amconf); void j_mfcccalc_free(MFCCCalc *mfcc); Index: julius4/libjulius/include/julius/recog.h diff -u julius4/libjulius/include/julius/recog.h:1.16 julius4/libjulius/include/julius/recog.h:1.17 --- julius4/libjulius/include/julius/recog.h:1.16 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/include/julius/recog.h Wed Oct 10 11:47:10 2012 @@ -70,7 +70,7 @@ * @author Akinobu Lee * @date Fri Feb 16 13:42:28 2007 * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * */ /* @@ -368,6 +368,7 @@ boolean strip_flag; ///< TRUE if skip invalid zero samples boolean enable_thread; ///< TRUE if input device needs threading boolean need_zmean; ///< TRUE if perform zmeansource + float level_coef; ///< Input level scaling factor /* work area */ int c_length; ///< Computed length of cycle buffer for zero-cross, actually equals to head margin length From sumomo ¡÷ users.sourceforge.jp Wed Oct 10 11:47:11 2012 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Wed, 10 Oct 2012 11:47:11 +0900 Subject: [Julius-cvs 794] CVS update: julius4/libjulius/src Message-ID: <1349837231.224964.2344.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/adin-cut.c diff -u julius4/libjulius/src/adin-cut.c:1.19 julius4/libjulius/src/adin-cut.c:1.20 --- julius4/libjulius/src/adin-cut.c:1.19 Wed Aug 15 15:50:27 2012 +++ julius4/libjulius/src/adin-cut.c Wed Oct 10 11:47:11 2012 @@ -95,7 +95,7 @@ * @author Akinobu LEE * @date Sat Feb 12 13:20:53 2005 * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * */ /* @@ -159,6 +159,7 @@ } #endif adin->need_zmean = jconf->preprocess.use_zmean; + adin->level_coef = jconf->preprocess.level_coef; /* calc & set internal parameter from configuration */ freq = jconf->input.sfreq; samples_in_msec = (float) freq / (float)1000.0; @@ -414,6 +415,12 @@ if (a->bp == 0) break; } } + if (cnt > 0 && a->level_coef != 1.0) { + /* scale the level of incoming input */ + for (i = a->bp; i < a->bp + cnt; i++) { + a->buffer[i] = (SP16) ((float)a->buffer[i] * a->level_coef); + } + } /*************************************************/ /* execute callback here for incoming raw data stream.*/ Index: julius4/libjulius/src/default.c diff -u julius4/libjulius/src/default.c:1.15 julius4/libjulius/src/default.c:1.16 --- julius4/libjulius/src/default.c:1.15 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/default.c Wed Oct 10 11:47:11 2012 @@ -17,7 +17,7 @@ * @author Akinobu Lee * @date Fri Feb 16 15:05:43 2007 * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * */ /* @@ -86,6 +86,7 @@ j->preprocess.strip_zero_sample = TRUE; j->preprocess.use_zmean = FALSE; + j->preprocess.level_coef = 1.0; j->reject.gmm_filename = NULL; j->reject.gmm_gprune_num = 10; Index: julius4/libjulius/src/jfunc.c diff -u julius4/libjulius/src/jfunc.c:1.9 julius4/libjulius/src/jfunc.c:1.10 --- julius4/libjulius/src/jfunc.c:1.9 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/jfunc.c Wed Oct 10 11:47:11 2012 @@ -19,7 +19,7 @@ * @author Akinobu Lee * @date Wed Aug 8 15:04:28 2007 * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * */ /* @@ -1639,4 +1639,21 @@ #endif +/** + * Change the scaling factor of input audio level. Set to 1.0 to disable. + * + * @param recog [i/o] engine instance + * @param factor [in] factor value (1.0 to disable scaling) + * + * @callgraph + * @callergraph + * @ingroup engine + */ +void +j_adin_change_input_scaling_factor(Recog *recog, float factor) +{ + recog->adin->level_coef = factor; + recog->jconf->preprocess.level_coef = factor; +} + /* end of file */ Index: julius4/libjulius/src/m_info.c diff -u julius4/libjulius/src/m_info.c:1.15 julius4/libjulius/src/m_info.c:1.16 --- julius4/libjulius/src/m_info.c:1.15 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/m_info.c Wed Oct 10 11:47:11 2012 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Thu May 12 14:14:01 2005 * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * */ /* @@ -893,6 +893,12 @@ } else { jlog("\t long-term DC removal = off\n"); } + jlog("\t long-term DC removal = off\n"); + if (jconf->preprocess.level_coef != 1.0) { + jlog("\t level scaling factor = %.2f\n", jconf->preprocess.level_coef); + } else { + jlog("\t level scaling factor = %.2f (disabled)\n", jconf->preprocess.level_coef); + } } jlog("\t reject short input = "); if (jconf->reject.rejectshortlen > 0) { Index: julius4/libjulius/src/m_options.c diff -u julius4/libjulius/src/m_options.c:1.26 julius4/libjulius/src/m_options.c:1.27 --- julius4/libjulius/src/m_options.c:1.26 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/m_options.c Wed Oct 10 11:47:11 2012 @@ -18,7 +18,7 @@ * @author Akinobu Lee * @date Thu May 12 18:52:07 2005 * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * */ /* @@ -979,6 +979,11 @@ if (!check_section(jconf, argv[i], JCONF_OPT_GLOBAL)) return FALSE; jconf->preprocess.use_zmean = FALSE; continue; + } else if (strmatch(argv[i],"-lvscale")) { /* input level scaling factor */ + if (!check_section(jconf, argv[i], JCONF_OPT_GLOBAL)) return FALSE; + GET_TMPARG; + jconf->preprocess.level_coef = (float)atof(tmparg); + continue; } else if (strmatch(argv[i],"-zmeanframe")) { /* enable frame-wise DC offset by zero mean */ if (!check_section(jconf, argv[i], JCONF_OPT_AM)) return FALSE; jconf->amnow->analysis.para.zmeanframe = TRUE; Index: julius4/libjulius/src/m_usage.c diff -u julius4/libjulius/src/m_usage.c:1.18 julius4/libjulius/src/m_usage.c:1.19 --- julius4/libjulius/src/m_usage.c:1.18 Sun Aug 5 10:26:54 2012 +++ julius4/libjulius/src/m_usage.c Wed Oct 10 11:47:11 2012 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Fri May 13 15:04:34 2005 * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * */ /* @@ -111,6 +111,7 @@ fprintf(fp, " [-adport portnum] adinnet port number to listen (%d)\n", jconf->input.adinnet_port); fprintf(fp, " [-48] enable 48kHz sampling with internal down sampler (OFF)\n"); fprintf(fp, " [-zmean/-nozmean] enable/disable DC offset removal (OFF)\n"); + fprintf(fp, " [-lvscale] input level scaling factor (1.0: OFF) (%.1f)\n", jconf->preprocess.level_coef); fprintf(fp, " [-nostrip] disable stripping off zero samples\n"); fprintf(fp, " [-record dir] record triggered speech data to dir\n"); fprintf(fp, " [-rejectshort msec] reject an input shorter than specified\n");