From sumomo ¡÷ users.sourceforge.jp Fri Sep 18 17:27:34 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 18 Sep 2009 17:27:34 +0900 Subject: [Julius-cvs 434] CVS update: julius4/libjulius/src Message-ID: <1253262454.081214.16390.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/recogmain.c diff -u julius4/libjulius/src/recogmain.c:1.13 julius4/libjulius/src/recogmain.c:1.14 --- julius4/libjulius/src/recogmain.c:1.13 Fri Jul 3 02:05:20 2009 +++ julius4/libjulius/src/recogmain.c Fri Sep 18 17:27:33 2009 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Wed Aug 8 14:53:53 2007 * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * */ @@ -581,11 +581,19 @@ if (jconf->input.type == INPUT_WAVEFORM) { #ifdef HAVE_PTHREAD /* close A/D-in thread here */ - if (recog->adin->enable_thread && ! recog->adin->input_side_segment) { - if (adin_thread_cancel(recog) == FALSE) { - return -2; + if (! recog->adin->input_side_segment) { + if (recog->adin->enable_thread) { + if (adin_thread_cancel(recog) == FALSE) { + return -2; + } + } else { + recog->adin->end_of_stream = TRUE; } } +#else + if (! recog->adin->input_side_segment) { + recog->adin->end_of_stream = TRUE; + } #endif /* end A/D input */ if (adin_end(recog->adin) == FALSE) { From sumomo ¡÷ users.sourceforge.jp Fri Sep 18 17:30:07 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 18 Sep 2009 17:30:07 +0900 Subject: [Julius-cvs 435] CVS update: julius4/libsent/src/adin Message-ID: <1253262607.121406.21217.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/adin/adin_portaudio.c diff -u julius4/libsent/src/adin/adin_portaudio.c:1.4 julius4/libsent/src/adin/adin_portaudio.c:1.5 --- julius4/libsent/src/adin/adin_portaudio.c:1.4 Fri Jul 3 02:05:20 2009 +++ julius4/libsent/src/adin/adin_portaudio.c Fri Sep 18 17:30:07 2009 @@ -44,7 +44,7 @@ * @author Akinobu LEE * @date Mon Feb 14 12:03:48 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -60,6 +60,9 @@ /* sound header */ #include "pa/portaudio.h" +#ifdef PortAudioStream +#define OLDVER +#endif #undef DDEBUG @@ -91,10 +94,19 @@ * @return 0 when no error, or 1 to terminate recording. */ static int +#ifdef OLDVER Callback(void *inbuf, void *outbuf, unsigned long len, PaTimestamp outTime, void *userdata) +#else +Callback(const void *inbuf, void *outbuf, unsigned long len, const PaStreamCallbackTimeInfo *outTime, PaStreamCallbackFlags statusFlags, void *userdata) +#endif { +#ifdef OLDVER SP16 *now; int avail; +#else + const SP16 *now; + unsigned long avail; +#endif int processed_local; int written; @@ -146,7 +158,11 @@ return(0); } +#ifdef OLDVER static PortAudioStream *stream; ///< Stream information +#else +static PaStream *stream; ///< Stream information +#endif /** * Device initialization: check device capability and open for recording. @@ -169,11 +185,13 @@ jlog("Stat: adin_portaudio: INPUT_DELAY_SEC = %d\n", INPUT_DELAY_SEC); jlog("Stat: adin_portaudio: audio cycle buffer length = %d bytes\n", cycle_buffer_len * sizeof(SP16)); +#ifdef OLDVER /* for safety... */ if (sizeof(SP16) != paInt16) { jlog("Error: adin_portaudio: SP16 != paInt16 !!\n"); return FALSE; } +#endif /* allocate and init */ current = processed = 0; @@ -190,9 +208,8 @@ } frames_per_buffer = 256; num_buffer = sfreq * latency / (frames_per_buffer * 1000); - jlog("Stat: adin_portaudio: framesPerBuffer=%d, NumBuffers(guess)=%d (%d)\n", - frames_per_buffer, num_buffer, - Pa_GetMinNumBuffers(frames_per_buffer, sfreq)); + jlog("Stat: adin_portaudio: framesPerBuffer=%d, NumBuffers(guess)=%d\n", + frames_per_buffer, num_buffer); jlog("Stat: adin_portaudio: audio I/O Latency = %d msec (data fragment = %d frames)\n", (frames_per_buffer * num_buffer) * 1000 / sfreq, (frames_per_buffer * num_buffer)); @@ -205,7 +222,10 @@ } err = Pa_OpenDefaultStream(&stream, 1, 0, paInt16, sfreq, - frames_per_buffer, num_buffer, + frames_per_buffer, +#ifdef OLDVER + num_buffer, +#endif Callback, NULL); if (err != paNoError) { jlog("Error: adin_portaudio: error in opening stream: %s\n", Pa_GetErrorText(err)); From sumomo ¡÷ users.sourceforge.jp Fri Sep 18 17:31:08 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 18 Sep 2009 17:31:08 +0900 Subject: [Julius-cvs 436] CVS update: julius4/julius Message-ID: <1253262668.596041.22167.nullmailer@users.sourceforge.jp> Index: julius4/julius/app.h diff -u julius4/julius/app.h:1.2 julius4/julius/app.h:1.3 --- julius4/julius/app.h:1.2 Tue Dec 18 17:45:48 2007 +++ julius4/julius/app.h Fri Sep 18 17:31:08 2009 @@ -1,6 +1,10 @@ #include +#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__) +#include +#else #include "config.h" +#endif #ifdef CHARACTER_CONVERSION #include "charconv.h" #endif From sumomo ¡÷ users.sourceforge.jp Fri Sep 18 17:31:08 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 18 Sep 2009 17:31:08 +0900 Subject: [Julius-cvs 437] CVS update: julius4/libsent/include/sent Message-ID: <1253262668.896243.22271.nullmailer@users.sourceforge.jp> Index: julius4/libsent/include/sent/adin.h diff -u julius4/libsent/include/sent/adin.h:1.6 julius4/libsent/include/sent/adin.h:1.7 --- julius4/libsent/include/sent/adin.h:1.6 Fri Jul 3 02:05:20 2009 +++ julius4/libsent/include/sent/adin.h Fri Sep 18 17:31:08 2009 @@ -19,7 +19,7 @@ * @author Akinobu LEE * @date Thu Feb 10 17:22:36 2005 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ */ /* * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University @@ -144,6 +144,11 @@ #define ZC_POSITIVE 1 ///< Positive mark used for zerocross #define ZC_NEGATIVE -1 ///< Negative mark used for zerocross + +#ifdef __cplusplus +extern "C" { +#endif + /* adin/adin_mic_*.c */ boolean adin_mic_standby(int freq, void *arg); boolean adin_mic_begin(char *pathname); @@ -225,4 +230,9 @@ void ds48to16_free(DS_BUFFER *ds); int ds48to16(SP16 *dst, SP16 *src, int srclen, int maxdstlen, DS_BUFFER *ds); +#ifdef __cplusplus +} +#endif + + #endif /* __SENT_ADIN__ */ Index: julius4/libsent/include/sent/dfa.h diff -u julius4/libsent/include/sent/dfa.h:1.4 julius4/libsent/include/sent/dfa.h:1.5 --- julius4/libsent/include/sent/dfa.h:1.4 Tue Aug 5 18:50:53 2008 +++ julius4/libsent/include/sent/dfa.h Fri Sep 18 17:31:08 2009 @@ -29,7 +29,7 @@ * @author Akinobu LEE * @date Thu Feb 10 18:21:27 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -93,6 +93,10 @@ WORD_ID sp_id; ///< Word ID of short pause word } DFA_INFO; +#ifdef __cplusplus +extern "C" { +#endif + DFA_INFO *dfa_info_new(); void dfa_info_free(DFA_INFO *dfa); void dfa_state_init(DFA_INFO *dinfo); @@ -131,4 +135,8 @@ void dfa_find_pause_word(DFA_INFO *dfa, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo); boolean dfa_pause_word_append(DFA_INFO *dst, DFA_INFO *src, int coffset); +#ifdef __cplusplus +} +#endif + #endif /* __SENT_DFA_H__ */ Index: julius4/libsent/include/sent/hmm.h diff -u julius4/libsent/include/sent/hmm.h:1.2 julius4/libsent/include/sent/hmm.h:1.3 --- julius4/libsent/include/sent/hmm.h:1.2 Tue Dec 18 17:45:50 2007 +++ julius4/libsent/include/sent/hmm.h Fri Sep 18 17:31:08 2009 @@ -21,7 +21,7 @@ * @author Akinobu LEE * @date Thu Feb 10 14:54:06 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -98,6 +98,10 @@ struct _seg_token *list; ///< Link to next token, NULL if last } SEGTOKEN; +#ifdef __cplusplus +extern "C" { +#endif + /* mkwhmm.c */ HMM *new_make_word_hmm(HTK_HMM_INFO *, HMM_Logical **, int, boolean *); HMM *new_make_word_hmm_with_lm(HTK_HMM_INFO *, HMM_Logical **, int, boolean *, LOGPROB *); @@ -112,4 +116,8 @@ void put_hmm_outprob(FILE *fp, HMM *d); void put_hmm(FILE *fp, HMM *d); +#ifdef __cplusplus +} +#endif + #endif /* __SENT_HMM_NEW2_H__ */ Index: julius4/libsent/include/sent/hmm_calc.h diff -u julius4/libsent/include/sent/hmm_calc.h:1.6 julius4/libsent/include/sent/hmm_calc.h:1.7 --- julius4/libsent/include/sent/hmm_calc.h:1.6 Thu Sep 25 14:00:07 2008 +++ julius4/libsent/include/sent/hmm_calc.h Fri Sep 18 17:31:08 2009 @@ -13,7 +13,7 @@ * @author Akinobu LEE * @date Thu Feb 10 14:54:06 2005 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * */ /* @@ -157,6 +157,10 @@ } HMMWork; +#ifdef __cplusplus +extern "C" { +#endif + /* addlog.c */ void make_log_tbl(); LOGPROB addlog(LOGPROB x, LOGPROB y); @@ -219,4 +223,9 @@ void gprune_beam_free(HMMWork *wrk); void gprune_beam(HMMWork *wrk, HTK_HMM_Dens **g, int gnum, int *last_id, int lnum); + +#ifdef __cplusplus +} +#endif + #endif /* __SENT_HMM_CALC_H__ */ Index: julius4/libsent/include/sent/htk_hmm.h diff -u julius4/libsent/include/sent/htk_hmm.h:1.6 julius4/libsent/include/sent/htk_hmm.h:1.7 --- julius4/libsent/include/sent/htk_hmm.h:1.6 Fri Nov 14 01:55:52 2008 +++ julius4/libsent/include/sent/htk_hmm.h Fri Sep 18 17:31:08 2009 @@ -16,7 +16,7 @@ * @author Akinobu LEE * @date Thu Feb 10 19:36:47 2005 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * */ /* @@ -413,6 +413,11 @@ //@} } HTK_HMM_INFO; + +#ifdef __cplusplus +extern "C" { +#endif + /* init_phmm.c */ void htk_hmm_set_pause_model(HTK_HMM_INFO *hmminfo, char *spmodel_name); /* rdhmmdef.c */ @@ -526,4 +531,9 @@ boolean write_binhmm(FILE *fp, HTK_HMM_INFO *hmm, Value *para); boolean read_binhmm(FILE *fp, HTK_HMM_INFO *hmm, boolean gzfile_p, Value *para); +#ifdef __cplusplus +} +#endif + + #endif /* __SENT_HTK_HMM_2_H__ */ Index: julius4/libsent/include/sent/htk_param.h diff -u julius4/libsent/include/sent/htk_param.h:1.2 julius4/libsent/include/sent/htk_param.h:1.3 --- julius4/libsent/include/sent/htk_param.h:1.2 Tue Dec 18 17:45:50 2007 +++ julius4/libsent/include/sent/htk_param.h Fri Sep 18 17:31:08 2009 @@ -48,7 +48,7 @@ * @author Akinobu LEE * @date Fri Feb 11 02:52:52 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -89,6 +89,10 @@ */ #define HTK_PARAM_INCREMENT_STEP_FRAME 200 +#ifdef __cplusplus +extern "C" { +#endif + boolean rdparam(char *, HTK_Param *); HTK_Param *new_param(); void free_param(HTK_Param *); @@ -110,4 +114,8 @@ void put_param(FILE *fp, HTK_Param *pinfo); void put_param_info(FILE *fp, HTK_Param *pinfo); +#ifdef __cplusplus +} +#endif + #endif /* __SENT_HTK_PARAM_H__ */ Index: julius4/libsent/include/sent/machines.h diff -u julius4/libsent/include/sent/machines.h:1.2 julius4/libsent/include/sent/machines.h:1.3 --- julius4/libsent/include/sent/machines.h:1.2 Tue Dec 18 17:45:50 2007 +++ julius4/libsent/include/sent/machines.h Fri Sep 18 17:31:08 2009 @@ -21,7 +21,7 @@ * @author Akinobu LEE * @date Fri Feb 11 03:38:31 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -37,8 +37,14 @@ #include #ifndef HAVE_STRCASECMP +#ifdef __cplusplus +extern "C" { +#endif int strcasecmp(char *s1, char *s2); int strncasecmp(char *s1, char *s2, size_t n); +#ifdef __cplusplus +} +#endif #endif #endif /* __SENT_MACHINES_H__ */ Index: julius4/libsent/include/sent/mfcc.h diff -u julius4/libsent/include/sent/mfcc.h:1.4 julius4/libsent/include/sent/mfcc.h:1.5 --- julius4/libsent/include/sent/mfcc.h:1.4 Tue Jun 17 10:20:51 2008 +++ julius4/libsent/include/sent/mfcc.h Fri Sep 18 17:31:08 2009 @@ -27,7 +27,7 @@ * @author Akinobu LEE * @date Fri Feb 11 03:40:52 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ @@ -205,6 +205,11 @@ LOGPROB max; ///< Maximum energy value of current input } ENERGYWork; + +#ifdef __cplusplus +extern "C" { +#endif + /**** mfcc-core.c ****/ MFCCWork *WMP_work_new(Value *para); void WMP_calc(MFCCWork *w, float *mfcc, Value *para); @@ -279,5 +284,8 @@ void calc_para_from_header(Value *para, short param_type, short vec_size); void put_para(FILE *fp, Value *para); +#ifdef __cplusplus +} +#endif #endif /* __MFCC_H__ */ Index: julius4/libsent/include/sent/ngram2.h diff -u julius4/libsent/include/sent/ngram2.h:1.7 julius4/libsent/include/sent/ngram2.h:1.8 --- julius4/libsent/include/sent/ngram2.h:1.7 Sat Jul 4 23:11:43 2009 +++ julius4/libsent/include/sent/ngram2.h Fri Sep 18 17:31:08 2009 @@ -95,7 +95,7 @@ * @author Akinobu LEE * @date Fri Feb 11 15:04:02 2005 * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * */ /* @@ -215,6 +215,11 @@ #define BINGRAM_NATURAL_BYTEORDER "LE" #endif + +#ifdef __cplusplus +extern "C" { +#endif + /* function declaration */ NNID search_ngram(NGRAM_INFO *ndata, int n, WORD_ID *w); LOGPROB ngram_prob(NGRAM_INFO *ndata, int n, WORD_ID *w); @@ -245,4 +250,8 @@ boolean make_voca_ref(NGRAM_INFO *ndata, WORD_INFO *winfo); void fix_uniprob_srilm(NGRAM_INFO *ndata, WORD_INFO *winfo); +#ifdef __cplusplus +} +#endif + #endif /* __SENT_NGRAM2_H__ */ Index: julius4/libsent/include/sent/ptree.h diff -u julius4/libsent/include/sent/ptree.h:1.4 julius4/libsent/include/sent/ptree.h:1.5 --- julius4/libsent/include/sent/ptree.h:1.4 Tue Feb 10 02:27:46 2009 +++ julius4/libsent/include/sent/ptree.h Fri Sep 18 17:31:08 2009 @@ -17,7 +17,7 @@ * @author Akinobu LEE * @date Fri Feb 11 17:27:24 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -64,6 +64,11 @@ struct _patnode *right1; ///< Link to right node (bit=1) } PATNODE; + +#ifdef __cplusplus +extern "C" { +#endif + int testbit(char *str, int slen, int bitplace); int testbit_max(char *str, int bitplace, int maxbitplace); int where_the_bit_differ(char *str1, char *str2); @@ -83,4 +88,8 @@ boolean aptree_write(FILE *fp, APATNODE *root, boolean (*save_data_func)(void *, FILE *fp)); boolean aptree_read(FILE *fp, APATNODE **root, BMALLOC_BASE **mroot, void *data, boolean (*load_data_func)(void **, void *, FILE *fp)); +#ifdef __cplusplus +} +#endif + #endif /* __PATRICIA_TREE_H__ */ Index: julius4/libsent/include/sent/speech.h diff -u julius4/libsent/include/sent/speech.h:1.2 julius4/libsent/include/sent/speech.h:1.3 --- julius4/libsent/include/sent/speech.h:1.2 Tue Dec 18 17:45:50 2007 +++ julius4/libsent/include/sent/speech.h Fri Sep 18 17:31:08 2009 @@ -23,7 +23,7 @@ * @author Akinobu LEE * @date Sat Feb 12 11:16:41 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -97,6 +97,11 @@ */ #define OUTPROB_CACHE_PERIOD 100 + +#ifdef __cplusplus +extern "C" { +#endif + /// Macro to convert smpPeriod (100nsec unit) to frequency (Hz) #define period2freq(A) (10000000.0 / (float)(A)) /// Macro to convert sampling frequency (Hz) to smpPeriod (100nsec unit) @@ -113,4 +118,8 @@ /* for an;z/strip.c */ int strip_zero(SP16 a[], int len); +#ifdef __cplusplus +} +#endif + #endif /* __SENT_SPEECH__ */ Index: julius4/libsent/include/sent/stddefs.h diff -u julius4/libsent/include/sent/stddefs.h:1.3 julius4/libsent/include/sent/stddefs.h:1.4 --- julius4/libsent/include/sent/stddefs.h:1.3 Tue Jan 22 22:01:55 2008 +++ julius4/libsent/include/sent/stddefs.h Fri Sep 18 17:31:08 2009 @@ -29,7 +29,7 @@ * @author Akinobu LEE * @date Sat Feb 12 11:49:37 2005 * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * */ /* @@ -44,14 +44,13 @@ /* load site-dependent configuration by configure script */ #if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__) -#include +#include #else #include #endif #include #include -#include #include #include #if !defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__) Index: julius4/libsent/include/sent/tcpip.h diff -u julius4/libsent/include/sent/tcpip.h:1.2 julius4/libsent/include/sent/tcpip.h:1.3 --- julius4/libsent/include/sent/tcpip.h:1.2 Tue Dec 18 17:45:50 2007 +++ julius4/libsent/include/sent/tcpip.h Fri Sep 18 17:31:08 2009 @@ -11,7 +11,7 @@ * @author Akinobu LEE * @date Sat Feb 12 12:26:15 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -53,6 +53,11 @@ /// Interval time between retry in seconds #define CONNECTION_RETRY_INTERVAL 2 /* sec. */ + +#ifdef __cplusplus +extern "C" { +#endif + /* net/rdwt.c */ int rd(int fd, char *data, int *len, int maxlen); int wt(int fd, char *data, int len); @@ -64,4 +69,8 @@ int close_socket(int sd); void cleanup_socket(); +#ifdef __cplusplus +} +#endif + #endif /* __SENT_SPEECH_TCPIP__ */ Index: julius4/libsent/include/sent/util.h diff -u julius4/libsent/include/sent/util.h:1.6 julius4/libsent/include/sent/util.h:1.7 --- julius4/libsent/include/sent/util.h:1.6 Sat Jan 31 00:04:18 2009 +++ julius4/libsent/include/sent/util.h Fri Sep 18 17:31:08 2009 @@ -21,7 +21,7 @@ * @author Akinobu LEE * @date Sat Feb 12 12:30:40 2005 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * */ /* @@ -57,6 +57,11 @@ struct _bmalloc_base *next; ///< Link to next data, NULL if no more } BMALLOC_BASE; + +#ifdef __cplusplus +extern "C" { +#endif + /* readfile.c */ char *getl(char *, int, FILE *); char *getl_fp(char *, int, FILE *); @@ -112,5 +117,8 @@ /* qsort.c */ void qsort_reentrant(void *base, int count, int size, int (*compare)(const void *, const void *, void *), void *pointer); +#ifdef __cplusplus +} +#endif #endif /* __SENT_UTIL_H__ */ Index: julius4/libsent/include/sent/vocabulary.h diff -u julius4/libsent/include/sent/vocabulary.h:1.5 julius4/libsent/include/sent/vocabulary.h:1.6 --- julius4/libsent/include/sent/vocabulary.h:1.5 Tue Feb 10 02:27:46 2009 +++ julius4/libsent/include/sent/vocabulary.h Fri Sep 18 17:31:08 2009 @@ -30,7 +30,7 @@ * @author Akinobu LEE * @date Sat Feb 12 12:38:13 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ /* @@ -80,6 +80,10 @@ BMALLOC_BASE *mroot; ///< Pointer for block memory allocation } WORD_INFO; +#ifdef __cplusplus +extern "C" { +#endif + WORD_INFO *word_info_new(); void word_info_free(WORD_INFO *winfo); void winfo_init(WORD_INFO *winfo); @@ -115,4 +119,8 @@ void print_all_basephone_name(HMM_basephone *base); void test_interword_triphone(HTK_HMM_INFO *hmminfo, WORD_INFO *winfo); +#ifdef __cplusplus +} +#endif + #endif /* __SENT_VOCA_H__ */ From sumomo ¡÷ users.sourceforge.jp Fri Sep 18 17:31:08 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 18 Sep 2009 17:31:08 +0900 Subject: [Julius-cvs 438] CVS update: julius4/libjulius/include/julius Message-ID: <1253262668.675225.22181.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/include/julius/extern.h diff -u julius4/libjulius/include/julius/extern.h:1.15 julius4/libjulius/include/julius/extern.h:1.16 --- julius4/libjulius/include/julius/extern.h:1.15 Sat Jul 4 23:11:42 2009 +++ julius4/libjulius/include/julius/extern.h Fri Sep 18 17:31:08 2009 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Mon Mar 7 23:19:14 2005 * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * */ /* @@ -24,6 +24,10 @@ /* should be included after all include files */ +#ifdef __cplusplus +extern "C" { +#endif + /* backtrellis.c */ void bt_init(BACKTRELLIS *bt); void bt_prepare(BACKTRELLIS *bt); @@ -321,3 +325,7 @@ boolean mfc_module_end(MFCCCalc *mfcc); int mfc_module_read(MFCCCalc *mfcc, int *new_t); char *mfc_module_input_name(MFCCCalc *mfcc); + +#ifdef __cplusplus +} +#endif Index: julius4/libjulius/include/julius/jfunc.h diff -u julius4/libjulius/include/julius/jfunc.h:1.6 julius4/libjulius/include/julius/jfunc.h:1.7 --- julius4/libjulius/include/julius/jfunc.h:1.6 Wed Mar 18 16:05:30 2009 +++ julius4/libjulius/include/julius/jfunc.h Fri Sep 18 17:31:08 2009 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Tue Nov 6 22:41:00 2007 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * */ /* @@ -28,6 +28,10 @@ #ifndef __J_JFUNC_H__ #define __J_JFUNC_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* recogmain.c */ int j_open_stream(Recog *recog, char *file_or_dev_name); int j_close_stream(Recog *recog); @@ -104,4 +108,8 @@ Recog *j_recog_new(); void j_recog_free(Recog *recog); +#ifdef __cplusplus +} +#endif + #endif /* __J_JFUNC_H__ */ Index: julius4/libjulius/include/julius/julius.h diff -u julius4/libjulius/include/julius/julius.h:1.3 julius4/libjulius/include/julius/julius.h:1.4 --- julius4/libjulius/include/julius/julius.h:1.3 Thu Sep 25 14:00:05 2008 +++ julius4/libjulius/include/julius/julius.h Fri Sep 18 17:31:08 2009 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Thu Mar 17 21:08:21 2005 * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * */ /* @@ -35,12 +35,13 @@ # ifdef BUILD_JULIAN # include # else -# include +# include +# include # endif #else #include -#endif #include +#endif /* read built-in definitions */ #include From sumomo ¡÷ users.sourceforge.jp Fri Sep 18 17:31:08 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 18 Sep 2009 17:31:08 +0900 Subject: [Julius-cvs 439] CVS update: julius4/libjulius/src Message-ID: <1253262668.772705.22224.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/m_jconf.c diff -u julius4/libjulius/src/m_jconf.c:1.5 julius4/libjulius/src/m_jconf.c:1.6 --- julius4/libjulius/src/m_jconf.c:1.5 Tue Oct 7 03:09:27 2008 +++ julius4/libjulius/src/m_jconf.c Fri Sep 18 17:31:08 2009 @@ -37,7 +37,7 @@ * @author Akinobu Lee * @date Thu May 12 14:16:18 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ /* @@ -381,8 +381,8 @@ char **c_argv; FILE *fp; int maxnum, step; - static const int len = 512; - char buf[len], cpy[len]; +#define BUFLEN 512 + char buf[BUFLEN], cpy[BUFLEN]; char *p, *dst, *dst_from; char *cdir; int i; @@ -402,7 +402,7 @@ c_argv = (char **)mymalloc(sizeof(char *) * maxnum); c_argv[0] = strcpy((char *)mymalloc(strlen(conffile)+1), conffile); c_argc = 1; - while (fgets_jconf(buf, len, fp) != NULL) { + while (fgets_jconf(buf, BUFLEN, fp) != NULL) { if (buf[0] == '\0') continue; p = buf; dst = cpy; while (1) { Index: julius4/libjulius/src/plugin.c diff -u julius4/libjulius/src/plugin.c:1.2 julius4/libjulius/src/plugin.c:1.3 --- julius4/libjulius/src/plugin.c:1.2 Wed Mar 18 16:05:30 2009 +++ julius4/libjulius/src/plugin.c Fri Sep 18 17:31:08 2009 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Sat Aug 2 09:46:09 2008 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -26,7 +26,11 @@ #ifdef ENABLE_PLUGIN +#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__) +#include +#else #include +#endif #include /** @@ -234,6 +238,33 @@ boolean plugin_load_dir(char *dir) { +#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__) + + WIN32_FIND_DATA FindFileData; + HANDLE hFind; + static char buf[512]; + int cnt; + + strncpy(buf, dir, 505); + strcat(buf, "\\*.dll"); + if ((hFind = FindFirstFile(buf, &FindFileData)) == INVALID_HANDLE_VALUE) { + jlog("ERROR: plugin_load: cannot open plugins dir \"%s\"\n", dir); + return FALSE; + } + + cnt = 0; + do { + jlog("STAT: file: %-23s ", FindFileData.cFileName); + if (plugin_load_file(buf)) cnt++; + } while (FindNextFile(hFind, &FindFileData)); + + FindClose(hFind); + jlog("STAT: %d files loaded\n", cnt); + + return TRUE; + +#else + DIR *d; struct dirent *f; static char buf[512]; @@ -255,6 +286,8 @@ jlog("STAT: %d files loaded\n", cnt); return TRUE; + +#endif } /** Index: julius4/libjulius/src/wchmm_check.c diff -u julius4/libjulius/src/wchmm_check.c:1.2 julius4/libjulius/src/wchmm_check.c:1.3 --- julius4/libjulius/src/wchmm_check.c:1.2 Tue Dec 18 17:45:49 2007 +++ julius4/libjulius/src/wchmm_check.c Fri Sep 18 17:31:08 2009 @@ -24,7 +24,7 @@ * @author Akinobu Lee * @date Sat Sep 24 15:45:06 2005 * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * */ /* @@ -327,8 +327,8 @@ void wchmm_check_interactive(WCHMM_INFO *wchmm) /* interactive check */ { - static const int len = 24; - char buf[len], *name; +#define MAXNAMELEN 24 + char buf[MAXNAMELEN], *name; int arg, newline; WORD_ID argw; boolean endflag; @@ -341,7 +341,7 @@ for (endflag = FALSE; endflag == FALSE;) { printf("===== syntax: command arg (\"H\" for help) > "); - if (fgets(buf, len, stdin) == NULL) break; + if (fgets(buf, MAXNAMELEN, stdin) == NULL) break; name = ""; arg = 0; if (isalpha(buf[0]) != 0 && buf[1] == ' ') { From sumomo ¡÷ users.sourceforge.jp Sun Sep 20 23:02:40 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Sun, 20 Sep 2009 23:02:40 +0900 Subject: [Julius-cvs 440] CVS update: julius4/libjulius/include/julius Message-ID: <1253455360.365054.9516.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/include/julius/julius.h diff -u julius4/libjulius/include/julius/julius.h:1.4 julius4/libjulius/include/julius/julius.h:1.5 --- julius4/libjulius/include/julius/julius.h:1.4 Fri Sep 18 17:31:08 2009 +++ julius4/libjulius/include/julius/julius.h Sun Sep 20 23:02:40 2009 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Thu Mar 17 21:08:21 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -35,8 +35,8 @@ # ifdef BUILD_JULIAN # include # else -# include -# include +# include +# include # endif #else #include From sumomo ¡÷ users.sourceforge.jp Sun Sep 20 23:02:40 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Sun, 20 Sep 2009 23:02:40 +0900 Subject: [Julius-cvs 441] CVS update: julius4/libsent/include/sent Message-ID: <1253455360.443413.9527.nullmailer@users.sourceforge.jp> Index: julius4/libsent/include/sent/stddefs.h diff -u julius4/libsent/include/sent/stddefs.h:1.4 julius4/libsent/include/sent/stddefs.h:1.5 --- julius4/libsent/include/sent/stddefs.h:1.4 Fri Sep 18 17:31:08 2009 +++ julius4/libsent/include/sent/stddefs.h Sun Sep 20 23:02:40 2009 @@ -29,7 +29,7 @@ * @author Akinobu LEE * @date Sat Feb 12 11:49:37 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -113,7 +113,6 @@ #define close _close #define eof _eof #define filelength _filelength -#define isatty _isatty #define lseek _lseek #define open _open #define read _read From sumomo ¡÷ users.sourceforge.jp Sun Sep 20 23:02:40 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Sun, 20 Sep 2009 23:02:40 +0900 Subject: [Julius-cvs 442] CVS update: julius4/libsent/src/adin Message-ID: <1253455360.526773.9535.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/adin/adin_portaudio.c diff -u julius4/libsent/src/adin/adin_portaudio.c:1.5 julius4/libsent/src/adin/adin_portaudio.c:1.6 --- julius4/libsent/src/adin/adin_portaudio.c:1.5 Fri Sep 18 17:30:07 2009 +++ julius4/libsent/src/adin/adin_portaudio.c Sun Sep 20 23:02:40 2009 @@ -44,7 +44,7 @@ * @author Akinobu LEE * @date Mon Feb 14 12:03:48 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ /* @@ -67,6 +67,21 @@ #undef DDEBUG /** + * Define this to choose which audio device to open by querying the + * device API type in the following order: + * + * ASIO -> DirectSound -> MME -> Others (OSS,...) + * + * This will be effective when using portaudio library with multiple + * Host API support, in which case Pa_OpenDefaultStream() will open + * the first found one (not the one with the optimal performance) + * + * (may not work on OLDVER) + * + */ +#undef CHOOSE_HOST_API + +/** * Maximum Data fragment Length in msec. Input can be delayed to this time. * You can override this value by specifying environment valuable * "LATENCY_MSEC". @@ -221,6 +236,57 @@ return(FALSE); } +#ifdef CHOOSE_HOST_API + + { + // choose a device to open + // preference order is: ASIO > DirectSound > MME > other + // On the selected API, the first device will be opened. + int i, devId; + PaDeviceIndex numDevice = Pa_GetDeviceCount(); + PaDeviceInfo *deviceInfo; + PaHostApiInfo *apiInfo; + PaStreamParameters param; + int iMME = -1, iDS = -1, iASIO = -1, iOther = -1; + + for(i=0;imaxInputChannels <= 0) continue; + apiInfo = Pa_GetHostApiInfo(deviceInfo->hostApi); + switch(apiInfo->type) { + case paMME:if (iMME < 0) iMME = i; break; + case paDirectSound:if (iDS < 0) iDS = i; break; + case paASIO:if (iASIO < 0) iASIO = i; break; + default:if (iOther < 0) iOther = i; break; + } + } + if (iASIO >= 0) devId = iASIO; + else if (iDS >= 0) devId = iDS; + else if (iMME >= 0) devId = iMME; + else devId = iOther; + + memset( ¶m, 0, sizeof(param)); + param.channelCount = 1; + param.device = devId; + param.sampleFormat = paInt16; + param.suggestedLatency = Pa_GetDeviceInfo(devId)->defaultLowInputLatency; + err = Pa_OpenStream(&stream, ¶m, NULL, sfreq, + frames_per_buffer, paNoFlag, + Callback, NULL); + if (err != paNoError) { + // When failed, fallback to default device + err = Pa_OpenDefaultStream(&stream, 1, 0, paInt16, sfreq, + frames_per_buffer, + Callback, NULL); + if (err != paNoError) { + jlog("Error: adin_portaudio: error in opening stream: %s\n", Pa_GetErrorText(err)); + return(FALSE); + } + } + } + +#else + err = Pa_OpenDefaultStream(&stream, 1, 0, paInt16, sfreq, frames_per_buffer, #ifdef OLDVER @@ -232,6 +298,8 @@ return(FALSE); } +#endif /* CHOOSE_HOST_API */ + return(TRUE); }