00001 00017 /* 00018 * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University 00019 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology 00020 * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology 00021 * All rights reserved 00022 */ 00023 00024 #include <julius.h> 00025 00039 static void 00040 m_errexit() 00041 { 00042 if (module_mode) { 00043 /* disconnect control module */ 00044 if (module_is_connected()) { 00045 module_send(module_sd, "<SYSINFO PROCESS=\"ERREXIT\"/>\n.\n"); 00046 module_disconnect(); 00047 } 00048 } else { 00049 j_printerr("Terminated\n"); 00050 } 00051 00052 /* release global variables allocated when parsing options */ 00053 opt_release(); 00054 00055 exit(1); /* program exit with status 1 */ 00056 } 00057 00071 static void 00072 m_exit() 00073 { 00074 if (module_mode) { 00075 /* disconnect control module */ 00076 if (module_is_connected()) { 00077 module_send(module_sd, "<SYSINFO PROCESS=\"EXIT\"/>\n.\n"); 00078 module_disconnect(); 00079 } 00080 } 00081 00082 /* release global variables allocated when parsing options */ 00083 opt_release(); 00084 00085 exit(0); /* program exit with status 0 */ 00086 } 00087 00088 /* system bootup */ 00102 void 00103 system_bootup() 00104 { 00105 /* set mybmalloc (block memory allocation) parameters first (optional) */ 00106 mybmalloc_set_param(); 00107 00108 /* set error exit function */ 00109 j_error_register_exitfunc(m_errexit); 00110 j_exit_register_exitfunc(m_exit); 00111 00112 /* set default param according to the compile flag */ 00113 if (strmatch(SETUP, "fast")) { 00114 nbest = 1; 00115 enveloped_bestfirst_width = 30; 00116 } else { 00117 nbest = 10; 00118 enveloped_bestfirst_width = 100; 00119 } 00120 00121 /* clear MFCC paramters */ 00122 /* parameter setting priority: 00123 user-specified > specified HTK Config > model-embedded > default */ 00124 /* when HTK Config is read, default values for HTK will be chosen */ 00125 undef_para(¶); 00126 undef_para(¶_hmm); 00127 undef_para(¶_default); 00128 undef_para(¶_htk); 00129 make_default_para(¶_default); 00130 make_default_para_htk(¶_htk); 00131 00132 }