From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:39:40 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:39:40 +0900 Subject: [Julius-cvs 443] CVS update: julius4/libjulius/include/julius Message-ID: <1256143180.866948.8890.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/include/julius/julius.h diff -u julius4/libjulius/include/julius/julius.h:1.5 julius4/libjulius/include/julius/julius.h:1.6 --- julius4/libjulius/include/julius/julius.h:1.5 Sun Sep 20 23:02:40 2009 +++ julius4/libjulius/include/julius/julius.h Thu Oct 22 01:39:40 2009 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Thu Mar 17 21:08:21 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ /* @@ -27,17 +27,8 @@ /* read configurable definitions */ #if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__) -/* - * - * You should define -DBUILD_JULIAN to compile Julian in WIN32(VC++) - * - */ -# ifdef BUILD_JULIAN -# include -# else # include # include -# endif #else #include #include From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:39:41 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:39:41 +0900 Subject: [Julius-cvs 444] CVS update: julius4/libsent/src/adin Message-ID: <1256143181.019166.8910.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/adin/adin_portaudio.c diff -u julius4/libsent/src/adin/adin_portaudio.c:1.6 julius4/libsent/src/adin/adin_portaudio.c:1.7 --- julius4/libsent/src/adin/adin_portaudio.c:1.6 Sun Sep 20 23:02:40 2009 +++ julius4/libsent/src/adin/adin_portaudio.c Thu Oct 22 01:39:40 2009 @@ -44,7 +44,7 @@ * @author Akinobu LEE * @date Mon Feb 14 12:03:48 2005 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * */ /* @@ -58,9 +58,9 @@ #include /* sound header */ -#include "pa/portaudio.h" +#include -#ifdef PortAudioStream +#ifndef paNonInterleaved #define OLDVER #endif @@ -79,7 +79,9 @@ * (may not work on OLDVER) * */ -#undef CHOOSE_HOST_API +#ifndef OLDVER +#define CHOOSE_HOST_API +#endif /** * Maximum Data fragment Length in msec. Input can be delayed to this time. From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:39:40 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:39:40 +0900 Subject: [Julius-cvs 445] CVS update: julius4/libsent Message-ID: <1256143180.952126.8902.nullmailer@users.sourceforge.jp> Index: julius4/libsent/configure diff -u julius4/libsent/configure:1.15 julius4/libsent/configure:1.16 --- julius4/libsent/configure:1.15 Sat Jun 20 16:47:06 2009 +++ julius4/libsent/configure Thu Oct 22 01:39:40 2009 @@ -2439,6 +2439,7 @@ pa-*) aldesc="PortAudio library" ADINOBJ="$ADINOBJ src/adin/pa/pa_lib.o src/adin/pa/pa_convert.o src/adin/pa/pa_trace.o src/adin/pa/pablio.o src/adin/pa/ringbuffer.o" + SOUNDINC="-Isrc/adin/pa" cat >> confdefs.h <<\EOF #define USE_MIC 1 EOF @@ -2561,21 +2562,21 @@ if test "$with_netaudio_dir" = auto ; then echo $ac_n "checking for DatLink/NetAudio support""... $ac_c" 1>&6 -echo "configure:2565: checking for DatLink/NetAudio support" >&5 +echo "configure:2566: checking for DatLink/NetAudio support" >&5 else echo $ac_n "checking for DatLink/NetAudio support on ${with_netaudio_dir}""... $ac_c" 1>&6 -echo "configure:2568: checking for DatLink/NetAudio support on ${with_netaudio_dir}" >&5 +echo "configure:2569: checking for DatLink/NetAudio support on ${with_netaudio_dir}" >&5 fi TMPCPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I${with_netaudio_dir}/include" use_netaudio=no cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2600,7 +2601,7 @@ have_zlib=no; if test "$use_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:2604: checking for deflate in -lz" >&5 +echo "configure:2605: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2608,7 +2609,7 @@ ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2638,17 +2639,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2642: checking for $ac_hdr" >&5 +echo "configure:2643: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2693,7 +2694,7 @@ # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2697: checking for $ac_word" >&5 +echo "configure:2698: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2740,7 +2741,7 @@ if test "$with_sndfile" = yes; then have_libsndfile=no echo $ac_n "checking for sf_open in -lsndfile""... $ac_c" 1>&6 -echo "configure:2744: checking for sf_open in -lsndfile" >&5 +echo "configure:2745: checking for sf_open in -lsndfile" >&5 ac_lib_var=`echo sndfile'_'sf_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2748,7 +2749,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsndfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2778,17 +2779,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2782: checking for $ac_hdr" >&5 +echo "configure:2783: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2830,7 +2831,7 @@ if test "$have_libsndfile" = no; then echo $ac_n "checking for sf_open_read in -lsndfile""... $ac_c" 1>&6 -echo "configure:2834: checking for sf_open_read in -lsndfile" >&5 +echo "configure:2835: checking for sf_open_read in -lsndfile" >&5 ac_lib_var=`echo sndfile'_'sf_open_read | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2838,7 +2839,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsndfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2868,17 +2869,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2872: checking for $ac_hdr" >&5 +echo "configure:2873: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* Index: julius4/libsent/configure.in diff -u julius4/libsent/configure.in:1.15 julius4/libsent/configure.in:1.16 --- julius4/libsent/configure.in:1.15 Sat Jun 20 16:47:06 2009 +++ julius4/libsent/configure.in Thu Oct 22 01:39:40 2009 @@ -3,7 +3,7 @@ dnl Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology dnl All rights reserved dnl -dnl $Id: configure.in,v 1.15 2009/06/20 07:47:06 sumomo Exp $ +dnl $Id: configure.in,v 1.16 2009/10/21 16:39:40 sumomo Exp $ dnl dnl Process this file with autoconf to produce a configure script. @@ -310,6 +310,7 @@ pa-*) aldesc="PortAudio library" ADINOBJ="$ADINOBJ src/adin/pa/pa_lib.o src/adin/pa/pa_convert.o src/adin/pa/pa_trace.o src/adin/pa/pablio.o src/adin/pa/ringbuffer.o" + SOUNDINC="-Isrc/adin/pa" AC_DEFINE(USE_MIC) case "$altype" in pa-winmm) From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:41:27 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:41:27 +0900 Subject: [Julius-cvs 446] CVS update: julius4/msvc Message-ID: <1256143287.073610.12289.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:42:00 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:42:00 +0900 Subject: [Julius-cvs 447] CVS update: julius4/msvc/Debug Message-ID: <1256143320.557105.12662.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:42:09 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:42:09 +0900 Subject: [Julius-cvs 448] CVS update: julius4/msvc/Release Message-ID: <1256143329.395214.13763.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:42:18 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:42:18 +0900 Subject: [Julius-cvs 449] CVS update: julius4/msvc/SampleApp Message-ID: <1256143338.483307.13863.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:42:28 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:42:28 +0900 Subject: [Julius-cvs 450] CVS update: julius4/msvc/config Message-ID: <1256143348.185953.13925.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:42:42 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:42:42 +0900 Subject: [Julius-cvs 451] CVS update: julius4/msvc/julius Message-ID: <1256143362.210903.14364.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:42:50 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:42:50 +0900 Subject: [Julius-cvs 452] CVS update: julius4/msvc/libjulius Message-ID: <1256143370.482660.14449.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:42:58 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:42:58 +0900 Subject: [Julius-cvs 453] CVS update: julius4/msvc/libsent Message-ID: <1256143378.907027.14529.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:43:07 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:43:07 +0900 Subject: [Julius-cvs 454] CVS update: julius4/msvc/portaudio Message-ID: <1256143387.493964.14636.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:43:15 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:43:15 +0900 Subject: [Julius-cvs 455] CVS update: julius4/msvc/zlib Message-ID: <1256143395.279510.14678.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:45:22 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:45:22 +0900 Subject: [Julius-cvs 456] CVS update: julius4/msvc/SampleApp/Debug Message-ID: <1256143522.918420.19280.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:45:22 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:45:22 +0900 Subject: [Julius-cvs 457] CVS update: julius4/msvc/SampleApp/Release Message-ID: <1256143522.984602.19286.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:46:05 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:46:05 +0900 Subject: [Julius-cvs 458] CVS update: julius4/msvc/julius/Debug Message-ID: <1256143565.733074.21520.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:46:05 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:46:05 +0900 Subject: [Julius-cvs 459] CVS update: julius4/msvc/julius/Release Message-ID: <1256143565.795414.21526.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:46:18 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:46:18 +0900 Subject: [Julius-cvs 460] CVS update: julius4/msvc/libjulius/Debug Message-ID: <1256143578.733912.21712.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:46:18 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:46:18 +0900 Subject: [Julius-cvs 461] CVS update: julius4/msvc/libjulius/Release Message-ID: <1256143578.794254.21719.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:46:29 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:46:29 +0900 Subject: [Julius-cvs 462] CVS update: julius4/msvc/libsent/Release Message-ID: <1256143589.630860.21865.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:46:29 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:46:29 +0900 Subject: [Julius-cvs 463] CVS update: julius4/msvc/libsent/Debug Message-ID: <1256143589.568866.21859.nullmailer@users.sourceforge.jp> From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 464] CVS update: julius4/msvc Message-ID: <1256143640.268401.22523.nullmailer@users.sourceforge.jp> Index: julius4/msvc/00README.txt diff -u /dev/null julius4/msvc/00README.txt:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/00README.txt Thu Oct 22 01:47:20 2009 @@ -0,0 +1,114 @@ +HOW TO COMPILE JULIUS ON MSVC / THE JULIUS CLASS +================================================= + +This file explains how to compile Julius on Microsoft Visual C++ 2008. +A sample application "SampleApp" and the Julius wrapper class is also +described here. See below to see how to compile Julius and test them. + +This package has been developed and tested on Visual C++ 2008 Express +Edition on Windows Vista 32bit/64bit. + + +1. Preparation +=============== + +"Microsoft DirectX SDK" is required to compile Julius. +You can get it from the Microsoft Web. + +Julius also uses these two open-source libraries: + + - zlib + - portaudio (V19) + +The pre-compiled win32 libraries and header files are already +included under the "zlib" and "portaudio" directory. + + +2. Compile +=========== + +Simply open the "JuliusLib.sln" file, and build it! +You will get "julius.exe" and "SampleApp.exe" under "Debug" or "Release" +directory. + +If you got an error when linking "zlib" or "portaudio", try compiling them +by your own. Get the sources, compile it, and then place all the .h and generated +.lib files under the corresponding directories, and rebuild Julius. If you have +re-compiled portaudio library, you may have to copy the generated portaudio DLL file +into the "Release" and "Debug" directories. + + +3. Test +======== + +"julius.exe" is a console application, which runs as the same as the +normally distributed version. + +The "SampleApp.exe" is a GUI application sample that uses JuliusLib. +When executed, Julius will be started and the engine events will be output +in the main window. You can test it as below: + + a) Prepare an acoustic model, language model and jconf file for them. + b) Place a Jconf file as "fast.jconf" at the same directory as the exe. + c) Modify the locale setting at line 98 of SampleApp.cpp to match the + character encoding of your language model. + d) Recompile and Run it. + +The Julius output log will be stored in a text file "juliuslog.txt". + + + +4. The Julius Class +==================== + +SampleApp uses a simple class definition "Julius.cpp" and "Julius.h". +They defines a wrapper class named "cJulius" that handles speech +recognition in a standard Windows messaging style. You can try to +use it like this: + +----------------------------------------------------------------- +#include "Julius.h" + +cJulius julius; + +.... + +// Windows Procedure callback +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch( message ) { + case WM_CREATE: + // start Julius when the main window is created + julius.initialize( "fast.jconf" ); + julius.startProcess( hWnd ); + break; + case WM_JULIUS: + // Julius events + switch( LOWORD( wParam ) ) { + case JEVENT_AUDIO_READY: ... + case JEVENT_RECOG_BEGIN: ... + case JEVENT_RESULT_FINAL:.... + } + ..... + } + ... +} +----------------------------------------------------------------- + +For more details, see SampleApp.cpp and Julius.cpp. + + + +5. About the character codes in the sources +============================================= + +The source code of Julius contains Japanese characters at EUC-JP encoding. +If you want to read them in MSVC++, convert them to UTF-8. + + +6. History +============== + +2009/11 (ver.4.1.3) + + INITIAL RELEASE. Index: julius4/msvc/JuliusLib.sln diff -u /dev/null julius4/msvc/JuliusLib.sln:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/JuliusLib.sln Thu Oct 22 01:47:20 2009 @@ -0,0 +1,49 @@ +ï»?+Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsent", "libsent\libsent.vcproj", "{0867DE93-30F0-4D6E-AB7D-7E4545E5F24F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjulius", "libjulius\libjulius.vcproj", "{4F9DC42E-E874-4885-819E-5C901F4E6079}" + ProjectSection(ProjectDependencies) = postProject + {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F} = {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "julius", "julius\julius.vcproj", "{C8E5508A-BEF2-4010-B99F-09C14CF5B89D}" + ProjectSection(ProjectDependencies) = postProject + {4F9DC42E-E874-4885-819E-5C901F4E6079} = {4F9DC42E-E874-4885-819E-5C901F4E6079} + {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F} = {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleApp", "SampleApp\SampleApp.vcproj", "{667FC1EB-6D97-4040-8ECE-A7B0E62B289B}" + ProjectSection(ProjectDependencies) = postProject + {4F9DC42E-E874-4885-819E-5C901F4E6079} = {4F9DC42E-E874-4885-819E-5C901F4E6079} + {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F} = {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F}.Debug|Win32.ActiveCfg = Debug|Win32 + {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F}.Debug|Win32.Build.0 = Debug|Win32 + {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F}.Release|Win32.ActiveCfg = Release|Win32 + {0867DE93-30F0-4D6E-AB7D-7E4545E5F24F}.Release|Win32.Build.0 = Release|Win32 + {4F9DC42E-E874-4885-819E-5C901F4E6079}.Debug|Win32.ActiveCfg = Debug|Win32 + {4F9DC42E-E874-4885-819E-5C901F4E6079}.Debug|Win32.Build.0 = Debug|Win32 + {4F9DC42E-E874-4885-819E-5C901F4E6079}.Release|Win32.ActiveCfg = Release|Win32 + {4F9DC42E-E874-4885-819E-5C901F4E6079}.Release|Win32.Build.0 = Release|Win32 + {C8E5508A-BEF2-4010-B99F-09C14CF5B89D}.Debug|Win32.ActiveCfg = Debug|Win32 + {C8E5508A-BEF2-4010-B99F-09C14CF5B89D}.Debug|Win32.Build.0 = Debug|Win32 + {C8E5508A-BEF2-4010-B99F-09C14CF5B89D}.Release|Win32.ActiveCfg = Release|Win32 + {C8E5508A-BEF2-4010-B99F-09C14CF5B89D}.Release|Win32.Build.0 = Release|Win32 + {667FC1EB-6D97-4040-8ECE-A7B0E62B289B}.Debug|Win32.ActiveCfg = Debug|Win32 + {667FC1EB-6D97-4040-8ECE-A7B0E62B289B}.Debug|Win32.Build.0 = Debug|Win32 + {667FC1EB-6D97-4040-8ECE-A7B0E62B289B}.Release|Win32.ActiveCfg = Release|Win32 + {667FC1EB-6D97-4040-8ECE-A7B0E62B289B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 465] CVS update: julius4/msvc/SampleApp Message-ID: <1256143640.508100.22569.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/Julius.cpp diff -u /dev/null julius4/msvc/SampleApp/Julius.cpp:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/Julius.cpp Thu Oct 22 01:47:20 2009 @@ -0,0 +1,560 @@ +#include +#include "Julius.h" + +///// ???????? +#define JCALLBACK(A, B) \ +static void A ( Recog *recog, void *data) \ +{\ + cJulius *j = (cJulius *) data;\ + SendMessage(j->getWindow(), WM_JULIUS, B, 0L);\ +} + +JCALLBACK(callback_engine_active, JEVENT_ENGINE_ACTIVE); +JCALLBACK(callback_engine_inactive, JEVENT_ENGINE_INACTIVE); +JCALLBACK(callback_audio_ready, JEVENT_AUDIO_READY); +JCALLBACK(callback_audio_begin, JEVENT_AUDIO_BEGIN); +JCALLBACK(callback_audio_end, JEVENT_AUDIO_END); +JCALLBACK(callback_recog_begin, JEVENT_RECOG_BEGIN); +JCALLBACK(callback_recog_end, JEVENT_RECOG_END); +JCALLBACK(callback_recog_frame, JEVENT_RECOG_FRAME); +JCALLBACK(callback_engine_pause, JEVENT_ENGINE_PAUSE); +JCALLBACK(callback_engine_resume, JEVENT_ENGINE_RESUME); + +static void callback_result_final(Recog *recog, void *data) +{ + cJulius *j = (cJulius *)data; + + int i; + WORD_INFO *winfo; + WORD_ID *seq; + int seqnum; + Sentence *s; + RecogProcess *r; + static char str[2048]; + static wchar_t wstr[2048]; + size_t size = 0; + WPARAM wparam = 0; + + r = j->getRecog()->process_list; + if (! r->live) return; + if (r->result.status < 0) { /* no results obtained */ + switch(r->result.status) { + case J_RESULT_STATUS_REJECT_POWER: + strcpy(str, ""); + break; + case J_RESULT_STATUS_TERMINATE: + strcpy(str, ""); + break; + case J_RESULT_STATUS_ONLY_SILENCE: + strcpy(str, ""); + break; + case J_RESULT_STATUS_REJECT_GMM: + strcpy(str, ""); + break; + case J_RESULT_STATUS_REJECT_SHORT: + strcpy(str, ""); + break; + case J_RESULT_STATUS_FAIL: + strcpy(str, ""); + break; + } + return; + } + + winfo = r->lm->winfo; + s = &(r->result.sent[0]); + seq = s->word; + seqnum = s->word_num; + str[0] = '\0'; + for(i=0;iwoutput[seq[i]]); + + mbstowcs_s( &size, wstr, str, strlen(str)+1); + + wparam = (r->result.status << 16) + JEVENT_RESULT_FINAL; + + SendMessage(j->getWindow(), WM_JULIUS, wparam, (LPARAM)wstr); +} + +// ???????? + +static void callback_wait_for_resume(Recog *recog, void *data) +{ + cJulius *j = (cJulius *)data; + // ????????Ž¯??????ŽÀ???? + SuspendThread( j->getThreadHandle() ); + // ???????ResumeThread()????????? +} + +//----------------------------------------------------------------------------------------- + +#ifdef APP_ADIN +static int callback_adin_fetch_input(SP16 *sampleBuffer, int reqlen) +{ + // ??????????????????A????????????????? + // ???????? reqlen ?? sampleBuffer ?????+} +#endif + +//----------------------------------------------------------------------------------------- + +// ?Ž¯?????????? +DWORD WINAPI recogThreadMain(LPVOID vdParam) +{ + int ret; + Recog *recog = (Recog *)vdParam; + ret = j_recognize_stream(recog); + if (ret == -1) ExitThread(FALSE); + ExitThread(TRUE); +} + +//----------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------------- + + +//================ +// ??????? +//================ +cJulius::cJulius( void ) : m_jconf( NULL ), m_recog( NULL ), m_opened( false ), m_threadHandle( NULL ), m_fpLogFile( NULL ) +{ +#ifdef APP_ADIN + m_appsource = 0; +#endif + setLogFile( "juliuslog.txt" ); +} + +//============== +// ?????? +//============== +cJulius::~cJulius( void ) +{ + release(); + if ( m_fpLogFile ) { + fclose(m_fpLogFile); + m_fpLogFile = NULL; + } +} + +//========= +// ??? +//========= +bool cJulius::initialize( int argnum, char *argarray[]) +{ + bool ret; + + release(); + + m_jconf = j_config_load_args_new( argnum, argarray ); + + if (m_jconf == NULL) { /* error */ + return false; + } + + ret = createEngine(); + + return ret; +} + +//========= +// ??? +//========= +bool cJulius::initialize( char *filename ) +{ + bool ret; + + release(); + + if (! loadJconf( filename )) return false; + + ret = createEngine(); + + return ret; +} + +//========= +// ??? +//========= +bool cJulius::loadJconf( char *filename ) +{ + if (m_jconf) { + if (j_config_load_file(m_jconf, filename) == -1) { + return false; + } + } else { + m_jconf = j_config_load_file_new( filename ); + if (m_jconf == NULL) { /* error */ + return false; + } + } + return true; +} + +//================== +// ????????+//================== +void cJulius::setLogFile( const char *filename ) +{ + if (m_fpLogFile) { + fclose( m_fpLogFile ); + } + m_fpLogFile = fopen( filename, "w" ); + if (m_fpLogFile) { + jlog_set_output( m_fpLogFile ); + } +} + +//================ +// ???????+//================ +bool cJulius::createEngine( void ) +{ +#ifdef APP_ADIN + ADIn *a; +#endif + + if (!m_jconf) return false; + if (m_recog) return false; + +#ifdef APP_ADIN + if (m_appsource != 0) { + // ???Ž©????????jconf????? + switch(m_appsource) { + case 1: // buffer input, batch + m_recog->jconf->input.type = INPUT_WAVEFORM; + m_recog->jconf->input.speech_input = SP_RAWFILE; + m_recog->jconf->decodeopt.realtime_flag = FALSE; + break; + case 2: // buffer input, incremental + m_recog->jconf->input.type = INPUT_WAVEFORM; + m_recog->jconf->input.speech_input = SP_RAWFILE; + m_recog->jconf->decodeopt.realtime_flag = TRUE; + break; + } + } +#endif + + // ??????? + m_recog = j_create_instance_from_jconf(m_jconf); + if (m_recog == NULL) { + return false; + } + + // ????????? + callback_add(m_recog, CALLBACK_EVENT_PROCESS_ONLINE, ::callback_engine_active, this); + callback_add(m_recog, CALLBACK_EVENT_PROCESS_OFFLINE, ::callback_engine_inactive, this); + callback_add(m_recog, CALLBACK_EVENT_SPEECH_READY, ::callback_audio_ready, this); + callback_add(m_recog, CALLBACK_EVENT_SPEECH_START, ::callback_audio_begin, this); + callback_add(m_recog, CALLBACK_EVENT_SPEECH_STOP, ::callback_audio_end, this); + callback_add(m_recog, CALLBACK_EVENT_RECOGNITION_BEGIN, ::callback_recog_begin, this); + callback_add(m_recog, CALLBACK_EVENT_RECOGNITION_END, ::callback_recog_end, this); + callback_add(m_recog, CALLBACK_EVENT_PASS1_FRAME, ::callback_recog_frame, this); + callback_add(m_recog, CALLBACK_EVENT_PAUSE, ::callback_engine_pause, this); + callback_add(m_recog, CALLBACK_EVENT_RESUME, ::callback_engine_resume, this); + callback_add(m_recog, CALLBACK_RESULT, ::callback_result_final, this); + callback_add(m_recog, CALLBACK_PAUSE_FUNCTION, ::callback_wait_for_resume, this); + +#ifdef APP_ADIN + // ????????????+ if (m_appsource != 0) { + // ???????Ž©?????+ a = m_recog->adin; + switch(m_appsource) { + case 1: // buffer input, batch + a->ad_standby = NULL; + a->ad_begin = NULL; + a->ad_end = NULL; + a->ad_resume = NULL; + a->ad_pause = NULL; + a->ad_terminate = NULL; + a->ad_read = callback_adin_fetch_input; + a->ad_input_name = NULL; + a->silence_cut_default = FALSE; + a->enable_thread = FALSE; + break; + case 2: // buffer input, incremental + a->ad_standby = NULL; + a->ad_begin = NULL; + a->ad_end = NULL; + a->ad_resume = NULL; + a->ad_pause = NULL; + a->ad_terminate = NULL; + a->ad_read = callback_adin_fetch_input; + a->ad_input_name = NULL; + a->silence_cut_default = FALSE; + a->enable_thread = FALSE; + break; + } + a->ds = NULL; + a->down_sample = FALSE; + if (adin_standby(a, m_recog->jconf->input.sfreq, NULL) == FALSE) return false; + if (adin_setup_param(a, m_recog->jconf) == FALSE) return false; + a->input_side_segment = FALSE; + } else { + // JuliusLib ?????C?? + if (! j_adin_init( m_recog ) ) return false; + } +#else + if (! j_adin_init( m_recog ) ) return false; +#endif + + return true; +} + +//==================== +// ???J??? +//==================== +bool cJulius::startProcess( HWND hWnd ) +{ + + if ( ! m_recog ) return false; + + // ??????????? + m_hWnd = hWnd; + + if (m_opened == false) { + // ??????? + switch(j_open_stream(m_recog, NULL)) { + case 0: /* succeeded */ + break; + case -1: /* error */ + // fprintf(stderr, "error in input stream\n"); + return false; + case -2: /* end of recognition process */ + //fprintf(stderr, "failed to begin input stream\n"); + return false; + } + // ??????? + m_threadHandle = CreateThread(NULL, 0, ::recogThreadMain, (LPVOID)m_recog, 0, &m_threadId); + if (m_threadHandle == NULL) { + j_close_stream(m_recog); + return false; + } + SetThreadPriority(m_threadHandle, THREAD_PRIORITY_HIGHEST); + + m_opened = true; + } + + return true; +} + +//================ +// ???I??? +//================ +void cJulius::stopProcess( void ) +{ + if (m_opened) { + // ?????????????????????j + j_close_stream(m_recog); + m_opened = false; + } +} + +//========== +// ???? +//========== +void cJulius::pause( void ) +{ + // ????? + // ???????Ž¯????? pause ??????? PAUSE_FUNCTION ???????ŽÀ? + j_request_terminate(m_recog); +} + +//========== +// ???? +//========== +void cJulius::resume( void ) +{ + // ?????????? + j_request_resume(m_recog); + // ?Ž¯????????????Ž¯????? resume ????????Ž¯????J?? + ResumeThread( m_threadHandle ); +} + +//============== +// ?????? +//============== +bool cJulius::loadGrammar( WORD_INFO *winfo, DFA_INFO *dfa, char *dictfile, char *dfafile, RecogProcess *r ) +{ + boolean ret; + + // load grammar + switch( r->lmvar ) { + case LM_DFA_WORD: + ret = init_wordlist(winfo, dictfile, r->lm->am->hmminfo, + r->lm->config->wordrecog_head_silence_model_name, + r->lm->config->wordrecog_tail_silence_model_name, + (r->lm->config->wordrecog_silence_context_name[0] == '\0') ? NULL : r->lm->config->wordrecog_silence_context_name, + r->lm->config->forcedict_flag); + if (ret == FALSE) { + return false; + } + break; + case LM_DFA_GRAMMAR: + ret = init_voca(winfo, dictfile, r->lm->am->hmminfo, FALSE, r->lm->config->forcedict_flag); + if (ret == FALSE) { + return false; + } + ret = init_dfa(dfa, dfafile); + if (ret == FALSE) { + return false; + } + break; + } + + return true; +} + +//============== +// ???? +//============== +bool cJulius::addGrammar( char *name, char *dictfile, char *dfafile, bool deleteAll ) +{ + WORD_INFO *winfo; + DFA_INFO *dfa; + RecogProcess *r = m_recog->process_list; + boolean ret; + + // load grammar + switch( r->lmvar ) { + case LM_DFA_WORD: + winfo = word_info_new(); + dfa = NULL; + ret = loadGrammar( winfo, NULL, dictfile, NULL, r ); + if ( ! ret ) { + word_info_free(winfo); + return false; + } + break; + case LM_DFA_GRAMMAR: + winfo = word_info_new(); + dfa = dfa_info_new(); + ret = loadGrammar( winfo, dfa, dictfile, dfafile, r ); + if ( ! ret ) { + word_info_free(winfo); + dfa_info_free(dfa); + return false; + } + } + if ( deleteAll ) { + /* delete all existing grammars */ + multigram_delete_all(r->lm); + } + /* register the new grammar to multi-gram tree */ + multigram_add(dfa, winfo, name, r->lm); + /* need to rebuild the global lexicon */ + /* tell engine to update at requested timing */ + schedule_grammar_update(m_recog); + /* make sure this process will be activated */ + r->active = 1; + + SendMessage(getWindow(), WM_JULIUS, JEVENT_GRAM_UPDATE, 0L); + + return true; +} + +//============== +// ?????? +//============== +bool cJulius::changeGrammar( char *name, char *dictfile, char *dfafile ) +{ + return addGrammar(name, dictfile, dfafile, true); +} + +//============== +// ????+//============== +bool cJulius::deleteGrammar( char *name ) +{ + RecogProcess *r = m_recog->process_list; + int gid; + + gid = multigram_get_id_by_name(r->lm, name); + if (gid == -1) return false; + + if (multigram_delete(gid, r->lm) == FALSE) { /* deletion marking failed */ + return false; + } + /* need to rebuild the global lexicon */ + /* tell engine to update at requested timing */ + schedule_grammar_update(m_recog); + + SendMessage(getWindow(), WM_JULIUS, JEVENT_GRAM_UPDATE, 0L); + + return true; +} + +//============== +// ?????? +//============== +bool cJulius::deactivateGrammar( char *name ) +{ + RecogProcess *r = m_recog->process_list; + int gid; + int ret; + + gid = multigram_get_id_by_name(r->lm, name); + if (gid == -1) return false; + + ret = multigram_deactivate(gid, r->lm); + if (ret == 1) { + /* already active */ + return true; + } else if (ret == -1) { + /* not found */ + return false; + } + /* tell engine to update at requested timing */ + schedule_grammar_update(m_recog); + SendMessage(getWindow(), WM_JULIUS, JEVENT_GRAM_UPDATE, 0L); + + return true; +} +//==================== +// ?????????+//==================== +bool cJulius::activateGrammar( char *name ) +{ + RecogProcess *r = m_recog->process_list; + int gid; + int ret; + + gid = multigram_get_id_by_name(r->lm, name); + if (gid == -1) return false; + + ret = multigram_activate(gid, r->lm); + if (ret == 1) { + /* already active */ + return true; + } else if (ret == -1) { + /* not found */ + return false; + } + /* tell engine to update at requested timing */ + schedule_grammar_update(m_recog); + SendMessage(getWindow(), WM_JULIUS, JEVENT_GRAM_UPDATE, 0L); + + return true; +} + +//========= +// ?? +//========= +void cJulius::release( void ) +{ + stopProcess(); + + if (m_threadHandle) { + CloseHandle(m_threadHandle); + m_threadHandle = NULL; + } else { + if ( m_recog ) { + j_recog_free( m_recog ); // jconf will be released inside this + m_recog = NULL; + m_jconf = NULL; + } + if ( m_jconf ) { + j_jconf_free( m_jconf ); + m_jconf = NULL; + } + } + +} \ No newline at end of file Index: julius4/msvc/SampleApp/Julius.h diff -u /dev/null julius4/msvc/SampleApp/Julius.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/Julius.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,86 @@ +// +// ?Julius ???F????????????????????? +// ??Ž¯?? +// ?????? +//?????? +// ????????????????????????? issue ?? +// ????Ž¯?? +// ????Ž¯????? +// ????Ž¯??+ +#ifndef _JULIUSCLASS_H_ +#define _JULIUSCLASS_H_ + +#include "julius/juliuslib.h" + +// ????? +#undef APP_ADIN + +// ????????? +#define WM_JULIUS (WM_USER + 1) + +// ????ID +enum { + JEVENT_ENGINE_ACTIVE, + JEVENT_ENGINE_INACTIVE, + JEVENT_ENGINE_PAUSE, + JEVENT_ENGINE_RESUME, + JEVENT_AUDIO_READY, + JEVENT_AUDIO_BEGIN, + JEVENT_AUDIO_END, + JEVENT_RECOG_BEGIN, + JEVENT_RECOG_END, + JEVENT_RECOG_FRAME, + JEVENT_RESULT_FRAME, + JEVENT_RESULT_PASS1, + JEVENT_RESULT_FINAL, + JEVENT_GRAM_UPDATE, +}; + + +class cJulius +{ + private : + Jconf *m_jconf; // Configuration parameter data + Recog *m_recog; // Engine instance + bool m_opened; + FILE *m_fpLogFile; + HANDLE m_threadHandle; + DWORD m_threadId; + HWND m_hWnd; +#ifdef APP_ADIN + int m_appsource +#endif + + public : + cJulius( void ); + ~cJulius( void ); + + void setLogFile( const char *filename ); + + bool initialize( int argnum, char *argarray[] ); + bool initialize( char *jconffile ); + bool loadJconf( char *jconffile ); + bool createEngine( void ); + + bool startProcess( HWND hWnd ); + void stopProcess( void ); + + void pause( void ); + void resume( void ); + + bool loadGrammar( WORD_INFO *winfo, DFA_INFO *dfa, char *dictfile, char *dfafile, RecogProcess *r ); + bool addGrammar( char *name, char *dictfile, char *dfafile, bool deleteAll = false ); + bool changeGrammar( char *name, char *dictfile, char *dfafile ); + bool deleteGrammar( char *name ); + bool deactivateGrammar( char *name ); + bool activateGrammar( char *name ); + + inline HWND getWindow( void ) { return m_hWnd; }; + inline Recog *getRecog( void ) { return m_recog; }; + inline HANDLE getThreadHandle( void ) { return m_threadHandle; }; + + void release( void ); +}; + +#endif Index: julius4/msvc/SampleApp/Resource.h diff -u /dev/null julius4/msvc/SampleApp/Resource.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/Resource.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,35 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SampleApp.rc +// + +#define IDS_APP_TITLE 103 + +#define IDR_MAINFRAME 128 +#define IDD_SAMPLEAPP_DIALOG 102 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_SAMPLEAPP 107 +#define IDI_SMALL 108 +#define IDC_SAMPLEAPP 109 +#define IDC_MYICON 2 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif + +#define IDM_PAUSE 32771 +#define IDM_RESUME 32772 + +// ??????????????? +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS + +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32773 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif Index: julius4/msvc/SampleApp/SampleApp.cpp diff -u /dev/null julius4/msvc/SampleApp/SampleApp.cpp:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/SampleApp.cpp Thu Oct 22 01:47:20 2009 @@ -0,0 +1,231 @@ +// SampleApp.cpp +// + +#include "stdafx.h" +#include "SampleApp.h" +#include "Julius.h" + +// Use a Julius class +cJulius julius; + +#define MAX_LOADSTRING 100 + +// Global variables +HINSTANCE hInst; // Current interface +TCHAR szTitle[MAX_LOADSTRING]; // Text on the title bar +TCHAR szWindowClass[MAX_LOADSTRING]; // Main windows class name + +// Function prototype definitions +ATOM MyRegisterClass(HINSTANCE hInstance); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + MSG msg; + HACCEL hAccelTable; + + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_SAMPLEAPP, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance); + + // Initialize application + if (!InitInstance (hInstance, nCmdShow)) + { + return FALSE; + } + + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SAMPLEAPP)); + + // Main message loop + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + + + +// +// Function: MyRegisterClass() +// +// Register a window class. +// +ATOM MyRegisterClass(HINSTANCE hInstance) +{ + WNDCLASSEX wcex; + + wcex.cbSize = sizeof(WNDCLASSEX); + + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SAMPLEAPP)); + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcex.lpszMenuName = MAKEINTRESOURCE(IDC_SAMPLEAPP); + wcex.lpszClassName = szWindowClass; + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); + + return RegisterClassEx(&wcex); +} + +// +// Function: InitInstance(HINSTANCE, int) +// +// Save instance handle and create a main window +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + HWND hWnd; + + // CHANGE THIS TO YOUR ENVIRONMENT AND YOUR MODEL ENCODING! + setlocale(LC_CTYPE, "Japanese_Japan.20932"); // Japanese EUC-JP + + hInst = hInstance; // store instance to global + + hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); + + if (!hWnd) + { + return FALSE; + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + return TRUE; +} + +// +// Function: WndProc(HWND, UINT, WPARAM, LPARAM) +// +// Process messages received at the main window +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + int jEventId; + int jResultId; + + switch (message) + { + case WM_CREATE: + if (! julius.initialize("fast.jconf") ) { + MessageBox(hWnd, L"failed to initialize", L"Error", MB_OK); + break; + } + if (! julius.startProcess(hWnd)) { + MessageBox(hWnd, L"failed to start process", L"Error", MB_OK); + } + break; + case WM_JULIUS: + jEventId = LOWORD(wParam); + switch (jEventId) { + case JEVENT_ENGINE_ACTIVE: DebugOut(hWnd, L"Engine Active"); break; + case JEVENT_ENGINE_INACTIVE:DebugOut(hWnd, L"Engine Inactive"); break; + case JEVENT_ENGINE_PAUSE: DebugOut(hWnd, L"Engine Pause"); break; + case JEVENT_ENGINE_RESUME: DebugOut(hWnd, L"Engine Resume"); break; + case JEVENT_AUDIO_READY: DebugOut(hWnd, L"Audio Input Ready"); break; + case JEVENT_AUDIO_BEGIN: DebugOut(hWnd, L"Audio Input Begin"); break; + case JEVENT_AUDIO_END: DebugOut(hWnd, L"Audio Input End"); break; + case JEVENT_RECOG_BEGIN: DebugOut(hWnd, L"Recognition Begin"); break; + case JEVENT_RECOG_END: DebugOut(hWnd, L"Recognition End"); break; + case JEVENT_RECOG_FRAME: /*DebugOut(hWnd, L"Recognition Frame")*/; break; + case JEVENT_RESULT_FRAME: /* DebugOut(hWnd, L"Result Frame"); */ break; + case JEVENT_RESULT_PASS1: DebugOut(hWnd, L"Result Pass1"); break; + case JEVENT_RESULT_FINAL: DebugOut(hWnd, L"Result Final"); + jResultId = HIWORD(wParam); + if (jResultId < 0) { + DebugOut(hWnd, L"No result"); + } else { + DebugOut(hWnd, (wchar_t *)lParam); + } + break; + case JEVENT_GRAM_UPDATE: DebugOut(hWnd, L"Grammar changed"); break; + default: DebugOut(hWnd, L"! unknown event"); break; + } + //InvalidateRect(hWnd, NULL, TRUE); + break; + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + switch (wmId) + { + case IDM_ABOUT: + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + break; + case IDM_EXIT: + DestroyWindow(hWnd); + break; + case IDM_PAUSE: + julius.pause(); + break; + case IDM_RESUME: + julius.resume(); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + julius.stopProcess(); + PostQuitMessage(0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Message handler for the version box +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + switch (message) + { + case WM_INITDIALOG: + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) + { + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + break; + } + return (INT_PTR)FALSE; +} + +// Output a debug string to the main window +void DebugOut(HWND hWnd, wchar_t *str) +{ + static int line = 0; + HDC hdc = GetDC(hWnd); + TextOut(hdc , 10 , 10 + line * 20, str, lstrlen(str)); + ReleaseDC(hWnd , hdc); + if (++line > 22) line = 0; +} \ No newline at end of file Index: julius4/msvc/SampleApp/SampleApp.h diff -u /dev/null julius4/msvc/SampleApp/SampleApp.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/SampleApp.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,5 @@ +#pragma once + +#include "resource.h" + +void DebugOut(HWND hWnd, wchar_t *str); Index: julius4/msvc/SampleApp/SampleApp.ico Index: julius4/msvc/SampleApp/SampleApp.rc diff -u /dev/null julius4/msvc/SampleApp/SampleApp.rc:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/SampleApp.rc Thu Oct 22 01:47:20 2009 @@ -0,0 +1,155 @@ +//Microsoft Visual C++ ?????????? ???????? +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE 2 ?????????????? +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +LANGUAGE 17, 1 +#pragma code_page(932) + +///////////////////////////////////////////////////////////////////////////// +// +// ???? +// + +// ???????????????????????????????A?????+// ID ??????????z?????? + +IDI_SAMPLEAPP ICON "SampleApp.ico" +IDI_SMALL ICON "small.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// ???? +// + +IDC_SAMPLEAPP MENU +BEGIN + POPUP "????(&F)" + BEGIN + MENUITEM "???????????&X)", IDM_EXIT + END + POPUP "??(&M)" + BEGIN + MENUITEM "?Ž¯??", IDM_PAUSE + MENUITEM "?Ž¯??", IDM_RESUME + END + POPUP "???(&H)" + BEGIN + MENUITEM "???????&A)...", IDM_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// ??????? +// + +IDC_SAMPLEAPP ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// ????? +// + +IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "???????SampleApp" +FONT 9, "MS UI Gothic" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20 + LTEXT "SampleApp, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC,42,26,114,8 + DEFPUSHBUTTON "OK",IDOK,113,41,50,14,WS_GROUP +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 163 + TOPMARGIN, 7 + BOTTOMMARGIN, 55 + END +END +#endif // APSTUDIO_INVOKED + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// ????? ???? +// + +STRINGTABLE +BEGIN + IDC_SAMPLEAPP "SAMPLEAPP" + IDS_APP_TITLE "SampleApp" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE 3 ?????????????? +// + +///////////////////////////////////////////////////////////////////////////// +#endif // APSTUDIO_INVOKED ?????Index: julius4/msvc/SampleApp/SampleApp.vcproj diff -u /dev/null julius4/msvc/SampleApp/SampleApp.vcproj:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/SampleApp.vcproj Thu Oct 22 01:47:20 2009 @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: julius4/msvc/SampleApp/small.ico Index: julius4/msvc/SampleApp/stdafx.cpp diff -u /dev/null julius4/msvc/SampleApp/stdafx.cpp:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/stdafx.cpp Thu Oct 22 01:47:20 2009 @@ -0,0 +1,8 @@ +// stdafx.cpp : ??C????? SampleApp.pch ??? +// ????? ????????????????????????? +// stdafx.obj ????????????????????B + +#include "stdafx.h" + +// TODO: ???????????STDAFX.H ???? +// ???????????????B Index: julius4/msvc/SampleApp/stdafx.h diff -u /dev/null julius4/msvc/SampleApp/stdafx.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/stdafx.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,22 @@ +// stdafx.h : ???V??? ?????? ??????????? ???????? +// ???????A??????????????????????????? ???? +// ??????B +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Windows ??????????????????O???? +// Windows ???? ????: +#include + +// C ????? ???? ???? +#include +#include +#include +#include + + +// TODO: ???????????????????????????B +#include \ No newline at end of file Index: julius4/msvc/SampleApp/targetver.h diff -u /dev/null julius4/msvc/SampleApp/targetver.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/targetver.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,24 @@ +#pragma once + +// ?????????????????????????????????????????????? +// ?????????ŽÀ????????????????????????? Windows ? Internet Explorer ?? +// ????????????????????????????????????????????????p????????????????????? +// ?????? + +// ??????????????v?????????????????????A??????????????? +// ??????????????????????????????AMSDN ?????????B +#ifndef WINVER // ??????????????? Windows Vista ???????????? +#define WINVER 0x0600 // ??? Windows ????????????????????????? +#endif + +#ifndef _WIN32_WINNT // ??????????????? Windows Vista ???????????? +#define _WIN32_WINNT 0x0600 // ??? Windows ????????????????????????? +#endif + +#ifndef _WIN32_WINDOWS // ??????????????? Windows 98 ???????????? +#define _WIN32_WINDOWS 0x0410 // ??? Windows Me ?????????????????????????????? +#endif + +#ifndef _WIN32_IE // ??????????????? Internet Explorer 7.0 ???????????? +#define _WIN32_IE 0x0700 // ??? IE ????????????????????????? +#endif From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 466] CVS update: julius4/msvc/Debug Message-ID: <1256143640.334055.22531.nullmailer@users.sourceforge.jp> Index: julius4/msvc/Debug/portaudio_x86.dll From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 467] CVS update: julius4/msvc/libjulius Message-ID: <1256143640.725806.22617.nullmailer@users.sourceforge.jp> Index: julius4/msvc/libjulius/libjulius.vcproj diff -u /dev/null julius4/msvc/libjulius/libjulius.vcproj:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/libjulius/libjulius.vcproj Thu Oct 22 01:47:20 2009 @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 468] CVS update: julius4/msvc/config Message-ID: <1256143640.589133.22590.nullmailer@users.sourceforge.jp> Index: julius4/msvc/config/config-msvc-julius.h diff -u /dev/null julius4/msvc/config/config-msvc-julius.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/config/config-msvc-julius.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,15 @@ +/* config.h. Generated automatically by configure. */ +/* Define if you use character conversion function */ +#define CHARACTER_CONVERSION 1 + +/* Define if you use Win32 character conversion API */ +#define USE_WIN32_MULTIBYTE 1 + +/* Define if you have iconv function */ +// #undef HAVE_ICONV + +/* Define if you have const char prototype in iconv function */ +// #define ICONV_CONST const + +/* Define if you use libjcode */ +#define USE_LIBJCODE Index: julius4/msvc/config/config-msvc-libjulius.h diff -u /dev/null julius4/msvc/config/config-msvc-libjulius.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/config/config-msvc-libjulius.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,254 @@ +/* include/julius/config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ +/** + * @file acconfig.h + * + * + * @brief config.h.in ?Econfigure.in ¤«¤éÀ¸À®¤¹?E¿¤á¤?autoconf ÍѥإåÀ + * + * ¤³¤Î¥Õ¥¡¥¤?EÏ¥½¡¼¥¹¤?饤¥ó¥??¼¥É¤µ¤??³¤È¤Ï¤¢¤ê¤Þ¤»¤? + * ¼ÂºÝ¤Ë¤Ï¤³¤ÎÆâÍÆ¤Ï config.h.in ¤ËËä¤á¹þ¤Þ?EƤ?ê¡?+ * configure ¤Ë¤è¤Ã¤Æ config.h.in ¤«¤éÀ¸À®¤µ?E?config.h ¤¬ + * ¥×?Á°¥é¥à¤Ë¤è¤Ã¤Æ»ÈÍѤµ?EÞ¤? + * + * @sa config.h, config.h.in, configure, configure.in + * + * + * + * @brief Autoconf header to generate config.h.in from configure.in + * + * This file is not included by any source file. The contents of this file + * is already copied in config.h.in, and the configuration script "configure" + * will generate config.h from config.h.in. It sets definitions according to + * the running environment and user-specified setting. The final config.h + * will be included by the sources. + * + * @sa config.h, config.h.in, configure, configure.in + * + * + * @author Akinobu LEE + * @date Sat Feb 19 12:53:54 2005 + * + * $Revision: 1.1 $ + * + */ + +/// Name of the Product. +#define JULIUS_PRODUCTNAME "JuliusLib" + +/// Version string +#define JULIUS_VERSION "4.1.2" + +/// Engine setting (value of "--enable-setup=..."). +#define JULIUS_SETUP "fast" + +/// Compilation host information +#define JULIUS_HOSTINFO "i686-pc-msvc" + + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define as the return type of signal handlers (int or void). */ +#define RETSIGTYPE void + +/* Define if you have the ANSI C header files. */ +//#define STDC_HEADERS 1 + +/* Define if you have POSIX thread */ +// #undef HAVE_PTHREAD + +/// For Julius, defined if using 1-gram factoringon the 1st pass instead of 2-gram factoring. +#define UNIGRAM_FACTORING 1 + +/** + * For Julius, defined if dictionary forms a single tree lexicon, sharing + * only a single root node. This saves memory of inter-word LM cache. + * + */ +/* #undef LOWMEM */ + +/** + * For Julius, defined if frequent words should be separated from the lexicon + * tree. This will improve accuracy on small beam, and default of "fast" + * setting. If none of LOWMEM and LOWMEM2 is defined, separation of short + * words from lexicon tree will be performed to get the better accuracy, at + * a cost of LM cache area on word head. + * + */ +#define LOWMEM2 1 + +/** + * If defined, use word-pair approximation on the 1st pass instead of + * 1-best approximation. + * + */ +/* #undef WPAIR */ + +/** + * When WPAIR is defined, only up to N tokens will be kept for each node + * instead of keeping tokens depending on the previous word. This may + * improve memory efficiency when word-pair approximation is used. + * + */ +/* #undef WPAIR_KEEP_NLIMIT */ + +/** + * If defined, generate a simple word graph instead of word trellis on + * the 1st pass. This limits word expansion on the 2nd pass + * to only the words on the word graph, and the final recognition accuracy + * can be decreased. You should enable this with WPAIR to get reasonable + * output. Please note that this is different + * from Word Graph Output of the 2nd pass which can be enabled by GRAPHOUT. + * + */ +/* #undef WORD_GRAPH */ + +/** + * If defined, use monophone tree lexicon on the 1st pass for speed up + * the search. This is EXPERIMENTAL, and should not be used. + * + */ +/* #undef MONOTREE */ + +/** + * Handle inter-word triphone on the 1st pass. This should be defined + * if using context-dependent acoustic model. If not defined, the context + * will not be considered any more. This is defined by default. + * + */ +#define PASS1_IWCD 1 + +/** + * On word expansion of the 2nd pass, Julius and Julian by default does + * not handle inter-word context dependency of the newly expanded words + * on the expansion time, and they will be computed when the hypothesis + * is popped from the stack at the later processing. If PASS2_STRICT_IWCD + * is defined, a strict inter-word triphone will be computed just on the + * word expansion time, by re-computing word edge phones on the connection + * point for all the word candidates. + * + * This option will results in a better + * recognition accuracy. However, the 2nd pass will become slower by the + * increasing acoustic matching cost. + * + */ +/* #undef PASS2_STRICT_IWCD */ + +/** + * Enable score envelope beaming on the hypothesis scoring in the 2nd pass. + * This will be defined by default. + * + */ +#define SCAN_BEAM 1 + +/// Set the default method of Gaussian pruning for tied-mixture model to safe algorithm +/* #undef GPRUNE_DEFAULT_SAFE */ + +/// Set the default method of Gaussian pruning for tied-mixture model to beam algorithm +#define GPRUNE_DEFAULT_BEAM 1 + +/** + * Enables confidence scoring for the output words. This will be defined + * by default. + * + */ +#define CONFIDENCE_MEASURE 1 + +/* use N-best confidence measure instead of search-time computation */ +/** + * By default, Julius/Julian uses search-time heuristic scores to get the + * posterior probability based word confidence measures on the search time. + * This default algorithm can output word confidence scores with a little + * additional computation without searching for much sentences. + * + * If you still use a trivial method of computing the word confidence scores + * from the N-best sentence list, you can define this. + * + */ +/* #undef CM_NBEST */ + +/** + * If defined, compute confidence scores for multiple alpha values. + * + */ +/* #undef CM_MULTIPLE_ALPHA */ + +/** + * Enable search space visualization feature. You need X11 and GTK to + * use this. + * + */ +/* #undef VISUALIZE */ + +/** + * When VISUALIZE is defind, this defines a command to play the recorded + * sound on the visualization window. + */ +/* #undef PLAYCOMMAND */ + +/** + * On Julius, if defined, fix some language model scoring bug on the 2nd pass. + * + */ +#define LM_FIX_DOUBLE_SCORING 1 + +/** + * Use dynamic word graph generation on the 2nd pass. + * The word candidates are fixed as soon as the word boundary is fixed + * in search, and as soon as same word appears in the same position, + * they will be merged. It results in much more words to be + * remained in the graph. + * + */ +#define GRAPHOUT_DYNAMIC 1 + +/** + * If defined with GRAPHOUT_DYNAMIC, use modified stack + * decoding algorithm for efficient word graph generation. + * + */ +#define GRAPHOUT_SEARCH 1 + +/** + * If defined, avoid expansion of low CM word on search. This may + * speed up + * + */ +/* #undef CM_SEARCH_LIMIT */ + +/** + * If defined, enable decoder-oriented VAD using short-pause segmentation + * scheme developed by NAIST team + * + */ + +/* #undef SPSEGMENT_NAIST */ + +/** + * If defined, enable a simple GMM-based VAD. Both frontend VAD and + * postprocessing rejection will be performed using the same GMM. + * + */ + +/* #undef GMM_VAD */ + + +/** + * This will be defined internally when in-decoder type VAD is enabled. + * + */ + +/* #undef BACKEND_VAD */ + +/** + * If enabled, do post-rejection by power + * + */ +/* #undef POWER_REJECT */ + +/** + * If defined, enable plugin support using dynamic object loading + * + */ +#define ENABLE_PLUGIN 1 Index: julius4/msvc/config/config-msvc-libsent.h diff -u /dev/null julius4/msvc/config/config-msvc-libsent.h:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/config/config-msvc-libsent.h Thu Oct 22 01:47:20 2009 @@ -0,0 +1,104 @@ +/* Version string */ +#define LIBSENT_VERSION "4.1.2" + +/* Audio API name */ +#define AUDIO_API_NAME "pa-dsound" + +/* Audio API description */ +#define AUDIO_API_DESC "PortAudio library (DirectSound)" + +/* Description of supported audio file formats */ +#define AUDIO_FORMAT_DESC "WAV and RAW" + +/* Description of gzip file reading method */ +#define GZIP_READING_DESC "zlib" + +/* Define to empty if the keyword does not work on your compiler. */ +//#undef const + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS + +/* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define if use microphone input */ +#define USE_MIC + +/* Define if use Datlink/Netaudio input */ +#undef USE_NETAUDIO + +/* Define if libsndfile support is available */ +#undef HAVE_LIBSNDFILE + +/* Define for libsndfile support (ver.1) */ +#undef HAVE_LIBSNDFILE_VER1 + +/* Define if you have spaudio library */ +#undef USE_SPLIB + +/* Define if you use integer word WORD_ID (for vocaburary of over 60k) */ +#undef WORDS_INT + +/* Define if you prefer addlog array function */ +#define USE_ADDLOG_ARRAY + +/* Define if you use zcat command for compressed file input */ +#undef ZCAT + +/* Define if you have socklen definition */ +#undef HAVE_SOCKLEN_T + +/* Define if you have the header file. */ +#undef HAVE_SNDFILE_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the nsl library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Define if you have zlib library (-lz). */ +#define HAVE_ZLIB + +/* Define if you have strcasecmp function */ +#undef HAVE_STRCASECMP + +/* Define if you have sleep function */ +#undef HAVE_SLEEP + +/* Define if you have iconv function */ +#undef HAVE_ICONV + +/* Define if you use libjcode */ +#undef USE_LIBJCODE + +/* Define if you allow class N-gram */ +#define CLASS_NGRAM + +/* Define if you want to enable process forking for each adinnet connection */ +#undef FORK_ADINNET + +/* Define if use sin/cos table for MFCC calculation */ +#define MFCC_SINCOS_TABLE + +/* Define if found */ +#undef HAVE_SYS_SOUNDCARD_H + +/* Define if found */ +#undef HAVE_MACHINE_SOUNDCARD_H + +/* Define if found */ +#undef HAVE_ALSA_ASOUNDLIB_H + +/* Define if exist and not exist */ +#undef HAVE_SYS_ASOUNDLIB_H + +/* Define if exist */ +#undef HAVE_ESD_H + +/* Define if MSD-HMM support is enabled */ +#undef ENABLE_MSD Index: julius4/msvc/config/version.c diff -u /dev/null julius4/msvc/config/version.c:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/config/version.c Thu Oct 22 01:47:20 2009 @@ -0,0 +1,252 @@ +/** + * @file version.c + * + * + * @brief ¥Ð¡¼¥¸¥ç¥ó¤ª¤è¤Ó¥³¥ó¥Ñ¥¤?E?ßÄê¤Î½ÐÎ?+ * + * + * + * + * @brief Output version and compilation-time configuration. + * + * + * + * @author Akinobu Lee + * @date Mon Sep 12 01:34:15 2005 + * + * $Revision: 1.1 $ + * + */ +/* + * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University + * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology + * Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology + * All rights reserved + */ + +/* Generated automatically from version.c.in by configure. */ + +#include + +#define CC "MSVC" ///< Used compiler +#define CFLAGS "" ///< Used flags for compilation + +/** + * + * ¥Ø¥Ã¥À¤ò½ÐÎϤ¹?E + * + * @param strm [in] ½ÐÎÏ¥¹¥È¥ê¡¼?E * + * + * Output application header. + * + * @param strm [in] output stream + * + */ +void +j_put_header(FILE *strm){ + if (strm == NULL) return; + fprintf(strm,"%s rev.%s (%s)\n\n", JULIUS_PRODUCTNAME, JULIUS_VERSION, JULIUS_SETUP); +} + +/** + * + * ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ¹?E * + * @param strm [in] ½ÐÎÏ¥¹¥È¥ê¡¼?E * + * + * Output version information. + * + * @param strm [in] output stream + * + */ +void +j_put_version(FILE *strm){ + if (strm == NULL) return; + fprintf(strm,"\n%s rev.%s (%s) built for %s\n\n", + JULIUS_PRODUCTNAME, JULIUS_VERSION, JULIUS_SETUP, JULIUS_HOSTINFO); + fprintf(strm,"Copyright (c) 1991-2009 Kawahara Lab., Kyoto University\n"); + fprintf(strm,"Copyright (c) 1997-2000 Information-technology Promotion Agency, Japan\n"); + fprintf(strm,"Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology\n"); + fprintf(strm,"Copyright (c) 2005-2009 Julius project team, Nagoya Institute of Technology\n\n"); +} + +/** + * + * ¥³¥ó¥Ñ¥¤?E?ÎÀßÄê¤ò½ÐÎϤ¹¤? + * + * @param strm [in] ÆþÎÏ¥¹¥È¥ê¡¼?E * + * + * Output compile-time settings. + * + * @param strm [in] input stream + * + */ +void +j_put_compile_defs(FILE *strm){ + if (strm == NULL) return; + fprintf(strm,"Engine specification:\n"); + fprintf(strm," - Base setup : %s\n", JULIUS_SETUP); + fprintf(strm," - Supported LM : DFA, N-gram, Word\n"); + fprintf(strm," - Extension :"); +#ifndef UNIGRAM_FACTORING + fprintf(strm, ", 2gramFactoring"); +#endif + +# ifdef GRAPHOUT_DYNAMIC +# ifdef GRAPHOUT_SEARCH + /* this is default */ + //fprintf(strm, " GraphOutSearch"); +# else + fprintf(strm, " GraphOutNonSearchTermination"); +# endif +# else + fprintf(strm, " GraphOutFromNBest"); +# endif +# ifndef GRAPHOUT_PRECISE_BOUNDARY + fprintf(strm, " DisableGraphOutPostFitting"); +# endif + +#ifdef CM_SEARCH_LIMIT +# ifdef CM_SEARCH_LIMIT_AFTER + fprintf(strm, " CMPruning_OnlyAfterReached"); +# else + fprintf(strm, " CMPruning"); +# endif +# ifdef CM_SEARCH_LIMIT_POP + fprintf(strm, " CMPruningOnPOP"); +# endif +#endif + +# ifndef LM_FIX_DOUBLE_SCORING + fprintf(strm, " NoLMFix"); +# endif + +# ifndef CLASS_NGRAM + fprintf(strm, " NoClassNGram"); +# endif + +#ifdef WORDS_INT + fprintf(strm, " WordsInt"); +#endif + +# ifdef LOWMEM + fprintf(strm, " SingleTree"); +# else +# ifdef LOWMEM2 + /* fprintf(strm, " HiFreqLinearTree");*/ +# else + fprintf(strm, " ShortWordTree"); +# endif +# endif + +# ifndef CATEGORY_TREE + //fprintf(strm, " NoCategoryTree"); +# endif + +#ifdef MONOTREE + fprintf(strm, " MonoTree1"); +#endif +#ifndef SCAN_BEAM + fprintf(strm, " NoScoreEnvelope"); +#endif +#ifndef PASS1_IWCD + fprintf(strm, " NoIWCD1"); +#endif +#ifdef PASS2_STRICT_IWCD + fprintf(strm, " StrictIWCD2"); +#endif + +#ifdef WPAIR +# ifdef WPAIR_KEEP_NLIMIT + fprintf(strm, " WordPairNApprox"); +# else + fprintf(strm, " WordPairApprox"); +# endif +#endif + +#ifdef WORD_GRAPH + fprintf(strm, " 1stPassWordGraph"); +#endif + +#ifndef CONFIDENCE_MEASURE + fprintf(strm, " NoCM"); +#else +# ifdef CM_NBEST + fprintf(strm, " N-bestCM"); +# endif +# ifdef CM_MULTIPLE_ALPHA + fprintf(strm, " MultiCMOutput"); +# endif +#endif /* CONFIDENCE_MEASURE */ + +#ifndef USE_MIC + fprintf(strm, " NoMic"); +#endif +#ifdef USE_NETAUDIO + fprintf(strm, " NetAudio"); +#endif +#ifndef HAVE_PTHREAD + fprintf(strm, " NoPThread"); +#endif +#ifdef HAVE_LIBSNDFILE + fprintf(strm, " LibSndFile"); +#endif + +#ifdef VISUALIZE + fprintf(strm, " Visualize"); +#endif + +#ifdef FORK_ADINNET + fprintf(strm, " ForkOnAdinnet"); +#endif + +#ifndef MFCC_SINCOS_TABLE + fprintf(strm, " DisableMFCCTable"); +#endif + +#ifndef LM_FIX_DOUBLE_SCORING + fprintf(strm, " DisableLMFix3.4"); +#endif + +#ifdef USE_LIBJCODE + fprintf(strm, " Libjcode"); +#endif + +#ifdef HAVE_ICONV + fprintf(strm, " IconvOutput"); +#endif + +#ifdef GMM_VAD + fprintf(strm, " GMMVAD"); +#endif + +#ifdef SPSEGMENT_NAIST + fprintf(strm, " DecoderVAD"); +#endif + +#ifdef POWER_REJECT + fprintf(strm, " PowerReject"); +#endif + + fprintf(strm, "\n"); + fprintf(strm," - Compiled by : %s %s\n", CC, CFLAGS); +} + +/** + * + * ¥é¥¤¥Ö¥é¥ê¤ÎÀßÄê¤ò½ÐÎϤ¹?E * + * @param strm [in] ½ÐÎÏ¥¹¥È¥ê¡¼?E * + * + * Output library configuration. + * + * @param strm [in] output stream + * + */ +void +j_put_library_defs(FILE *strm) { + if (strm == NULL) return; + fprintf(strm, "Library configuration: "); + confout(strm); + fprintf(strm, "\n"); +} + +/* end of file */ From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 469] CVS update: julius4/msvc/libsent Message-ID: <1256143640.790385.22628.nullmailer@users.sourceforge.jp> Index: julius4/msvc/libsent/libsent.vcproj diff -u /dev/null julius4/msvc/libsent/libsent.vcproj:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/libsent/libsent.vcproj Thu Oct 22 01:47:20 2009 @@ -0,0 +1,671 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 470] CVS update: julius4/msvc/Release Message-ID: <1256143640.404553.22538.nullmailer@users.sourceforge.jp> Index: julius4/msvc/Release/portaudio_x86.dll From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 01:47:20 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 01:47:20 +0900 Subject: [Julius-cvs 471] CVS update: julius4/msvc/julius Message-ID: <1256143640.658144.22602.nullmailer@users.sourceforge.jp> Index: julius4/msvc/julius/julius.vcproj diff -u /dev/null julius4/msvc/julius/julius.vcproj:1.1 --- /dev/null Thu Oct 22 01:47:20 2009 +++ julius4/msvc/julius/julius.vcproj Thu Oct 22 01:47:20 2009 @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 02:06:49 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 02:06:49 +0900 Subject: [Julius-cvs 472] CVS update: julius4/msvc Message-ID: <1256144809.487055.15292.nullmailer@users.sourceforge.jp> Index: julius4/msvc/00README.txt diff -u julius4/msvc/00README.txt:1.1 julius4/msvc/00README.txt:1.2 --- julius4/msvc/00README.txt:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/00README.txt Thu Oct 22 02:06:49 2009 @@ -23,6 +23,9 @@ The pre-compiled win32 libraries and header files are already included under the "zlib" and "portaudio" directory. +You need an acoustic model and a language model to run Julius as speech recognizer. +See the Julius Web for more details. + 2. Compile =========== @@ -41,12 +44,13 @@ 3. Test ======== -"julius.exe" is a console application, which runs as the same as the -normally distributed version. +! You need an acoustic model and a language model to run Julius as speech recognizer. +! See the Julius Web for more details. + +"julius.exe" is a console application, which just runs as the same as the normal win32 version. -The "SampleApp.exe" is a GUI application sample that uses JuliusLib. -When executed, Julius will be started and the engine events will be output -in the main window. You can test it as below: +The "SampleApp.exe" is a sample GUI application. Julius will start and the engine events will +be output to the main window. You can test it by the procedure below: a) Prepare an acoustic model, language model and jconf file for them. b) Place a Jconf file as "fast.jconf" at the same directory as the exe. @@ -95,8 +99,7 @@ } ----------------------------------------------------------------- -For more details, see SampleApp.cpp and Julius.cpp. - +See SampleApp.cpp and Julius.cpp for details. 5. About the character codes in the sources From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 20:02:41 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 20:02:41 +0900 Subject: [Julius-cvs 473] CVS update: julius4/msvc/SampleApp Message-ID: <1256209361.767487.6401.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/Julius.cpp diff -u julius4/msvc/SampleApp/Julius.cpp:1.1 julius4/msvc/SampleApp/Julius.cpp:1.2 --- julius4/msvc/SampleApp/Julius.cpp:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/Julius.cpp Thu Oct 22 20:02:41 2009 @@ -1,25 +1,24 @@ #include #include "Julius.h" -///// ???????? -#define JCALLBACK(A, B) \ -static void A ( Recog *recog, void *data) \ -{\ - cJulius *j = (cJulius *) data;\ - SendMessage(j->getWindow(), WM_JULIUS, B, 0L);\ -} - -JCALLBACK(callback_engine_active, JEVENT_ENGINE_ACTIVE); -JCALLBACK(callback_engine_inactive, JEVENT_ENGINE_INACTIVE); -JCALLBACK(callback_audio_ready, JEVENT_AUDIO_READY); -JCALLBACK(callback_audio_begin, JEVENT_AUDIO_BEGIN); -JCALLBACK(callback_audio_end, JEVENT_AUDIO_END); -JCALLBACK(callback_recog_begin, JEVENT_RECOG_BEGIN); -JCALLBACK(callback_recog_end, JEVENT_RECOG_END); -JCALLBACK(callback_recog_frame, JEVENT_RECOG_FRAME); -JCALLBACK(callback_engine_pause, JEVENT_ENGINE_PAUSE); -JCALLBACK(callback_engine_resume, JEVENT_ENGINE_RESUME); +// ----------------------------------------------------------------------------- +// JuliusLib callback functions +// + +#define JCALLBACK(A, B) static void A (Recog *recog, void *data) { cJulius *j = (cJulius *) data; SendMessage(j->getWindow(), WM_JULIUS, B, 0L);} + +JCALLBACK(callback_engine_active, JEVENT_ENGINE_ACTIVE) +JCALLBACK(callback_engine_inactive, JEVENT_ENGINE_INACTIVE) +JCALLBACK(callback_audio_ready, JEVENT_AUDIO_READY) +JCALLBACK(callback_audio_begin, JEVENT_AUDIO_BEGIN) +JCALLBACK(callback_audio_end, JEVENT_AUDIO_END) +JCALLBACK(callback_recog_begin, JEVENT_RECOG_BEGIN) +JCALLBACK(callback_recog_end, JEVENT_RECOG_END) +JCALLBACK(callback_recog_frame, JEVENT_RECOG_FRAME) +JCALLBACK(callback_engine_pause, JEVENT_ENGINE_PAUSE) +JCALLBACK(callback_engine_resume, JEVENT_ENGINE_RESUME) +// callback to get result static void callback_result_final(Recog *recog, void *data) { cJulius *j = (cJulius *)data; @@ -68,36 +67,34 @@ str[0] = '\0'; for(i=0;iwoutput[seq[i]]); + // convert to wide char mbstowcs_s( &size, wstr, str, strlen(str)+1); + // set status parameter wparam = (r->result.status << 16) + JEVENT_RESULT_FINAL; + // send message SendMessage(j->getWindow(), WM_JULIUS, wparam, (LPARAM)wstr); } -// ???????? - +// callbackk for pause static void callback_wait_for_resume(Recog *recog, void *data) { cJulius *j = (cJulius *)data; - // ????????Ž¯??????ŽÀ???? + // Stop running the engine thread SuspendThread( j->getThreadHandle() ); - // ???????ResumeThread()????????? + // the engine thread will wait until the main thread calls ResumeThread() for it } -//----------------------------------------------------------------------------------------- - #ifdef APP_ADIN static int callback_adin_fetch_input(SP16 *sampleBuffer, int reqlen) { - // ??????????????????A????????????????? - // ???????? reqlen ?? sampleBuffer ?????+ // If shared audio buffer has some new data, or some data remains from the last call, + // get the samples into sampleBuffer at most reqlen length. } #endif -//----------------------------------------------------------------------------------------- - -// ?Ž¯?????????? +// main function for the engine thread DWORD WINAPI recogThreadMain(LPVOID vdParam) { int ret; @@ -108,12 +105,12 @@ } //----------------------------------------------------------------------------------------- +// Julius class definition //----------------------------------------------------------------------------------------- - -//================ -// ??????? -//================ +//============= +// Constructor +//============= cJulius::cJulius( void ) : m_jconf( NULL ), m_recog( NULL ), m_opened( false ), m_threadHandle( NULL ), m_fpLogFile( NULL ) { #ifdef APP_ADIN @@ -122,9 +119,9 @@ setLogFile( "juliuslog.txt" ); } -//============== -// ?????? -//============== +//============ +// Destructor +//============ cJulius::~cJulius( void ) { release(); @@ -134,9 +131,9 @@ } } -//========= -// ??? -//========= +//================================= +// Initialize, with argument array +//================================= bool cJulius::initialize( int argnum, char *argarray[]) { bool ret; @@ -154,9 +151,9 @@ return ret; } -//========= -// ??? -//========= +//=============================== +// Initialize, with a Jconf file +//=============================== bool cJulius::initialize( char *filename ) { bool ret; @@ -170,9 +167,9 @@ return ret; } -//========= -// ??? -//========= +//=================== +// Load a Jconf file +//=================== bool cJulius::loadJconf( char *filename ) { if (m_jconf) { @@ -188,9 +185,9 @@ return true; } -//================== -// ????????-//================== +//============================================== +// Set a log file to save Julius engine outputs +//============================================== void cJulius::setLogFile( const char *filename ) { if (m_fpLogFile) { @@ -202,9 +199,9 @@ } } -//================ -// ???????-//================ +//======================== +// Create engine instance +//======================== bool cJulius::createEngine( void ) { #ifdef APP_ADIN @@ -216,7 +213,6 @@ #ifdef APP_ADIN if (m_appsource != 0) { - // ???Ž©????????jconf????? switch(m_appsource) { case 1: // buffer input, batch m_recog->jconf->input.type = INPUT_WAVEFORM; @@ -232,13 +228,13 @@ } #endif - // ??????? + // Create engine instance m_recog = j_create_instance_from_jconf(m_jconf); if (m_recog == NULL) { return false; } - // ????????? + // Register callbacks callback_add(m_recog, CALLBACK_EVENT_PROCESS_ONLINE, ::callback_engine_active, this); callback_add(m_recog, CALLBACK_EVENT_PROCESS_OFFLINE, ::callback_engine_inactive, this); callback_add(m_recog, CALLBACK_EVENT_SPEECH_READY, ::callback_audio_ready, this); @@ -253,9 +249,8 @@ callback_add(m_recog, CALLBACK_PAUSE_FUNCTION, ::callback_wait_for_resume, this); #ifdef APP_ADIN - // ????????????+ // Initialize application side audio input if (m_appsource != 0) { - // ???????Ž©????? a = m_recog->adin; switch(m_appsource) { case 1: // buffer input, batch @@ -289,7 +284,7 @@ if (adin_setup_param(a, m_recog->jconf) == FALSE) return false; a->input_side_segment = FALSE; } else { - // JuliusLib ?????C?? + // Let JuliusLib get audio input if (! j_adin_init( m_recog ) ) return false; } #else @@ -299,9 +294,9 @@ return true; } -//==================== -// ???J??? -//==================== +//============================================== +// Open stream and start the recognition thread +//============================================== bool cJulius::startProcess( HWND hWnd ) { @@ -336,42 +331,43 @@ return true; } -//================ -// ???I??? -//================ +//================================================== +// Close audio stream and detach recognition thread +//================================================== void cJulius::stopProcess( void ) { if (m_opened) { - // ?????????????????????j + // recognition thread will exit when audio input is closed j_close_stream(m_recog); m_opened = false; } } -//========== -// ???? -//========== +//=================== +// Pause recognition +//=================== void cJulius::pause( void ) { - // ????? - // ???????Ž¯????? pause ??????? PAUSE_FUNCTION ???????ŽÀ? + // request library to pause + // After pause, the recognition thread will issue pause event + // and then enter callback_wait_for_resume(), where thread will pause. j_request_terminate(m_recog); } -//========== -// ???? -//========== +//==================== +// Resume recognition +//==================== void cJulius::resume( void ) { - // ?????????? + // request library to resume j_request_resume(m_recog); - // ?Ž¯????????????Ž¯????? resume ????????Ž¯????J?? + // resume the recognition thread ResumeThread( m_threadHandle ); } -//============== -// ?????? -//============== +//================== +// Load DFA grammar +//================== bool cJulius::loadGrammar( WORD_INFO *winfo, DFA_INFO *dfa, char *dictfile, char *dfafile, RecogProcess *r ) { boolean ret; @@ -403,9 +399,9 @@ return true; } -//============== -// ???? -//============== +//================= +// Add DFA grammar +//================= bool cJulius::addGrammar( char *name, char *dictfile, char *dfafile, bool deleteAll ) { WORD_INFO *winfo; @@ -452,16 +448,16 @@ } //============== -// ?????? +// Swap grammar //============== bool cJulius::changeGrammar( char *name, char *dictfile, char *dfafile ) { return addGrammar(name, dictfile, dfafile, true); } -//============== -// ????-//============== +//============================ +// Delete grammar by its name +//============================ bool cJulius::deleteGrammar( char *name ) { RecogProcess *r = m_recog->process_list; @@ -482,9 +478,9 @@ return true; } -//============== -// ?????? -//============== +//================================ +// Deactivate grammar by its name +//================================ bool cJulius::deactivateGrammar( char *name ) { RecogProcess *r = m_recog->process_list; @@ -508,9 +504,10 @@ return true; } -//==================== -// ?????????-//==================== + +//================================= +// Re-activate grammar by its name +//================================= bool cJulius::activateGrammar( char *name ) { RecogProcess *r = m_recog->process_list; @@ -535,9 +532,9 @@ return true; } -//========= -// ?? -//========= +//===================================== +// Stop processes and release all data +//===================================== void cJulius::release( void ) { stopProcess(); Index: julius4/msvc/SampleApp/Julius.h diff -u julius4/msvc/SampleApp/Julius.h:1.1 julius4/msvc/SampleApp/Julius.h:1.2 --- julius4/msvc/SampleApp/Julius.h:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/Julius.h Thu Oct 22 20:02:41 2009 @@ -1,25 +1,15 @@ -// -// ?Julius ???F????????????????????? -// ??Ž¯?? -// ?????? -//?????? -// ????????????????????????? issue ?? -// ????Ž¯?? -// ????Ž¯????? -// ????Ž¯??- #ifndef _JULIUSCLASS_H_ #define _JULIUSCLASS_H_ #include "julius/juliuslib.h" -// ????? +// for development codes: do not define this #undef APP_ADIN -// ????????? +// Julius event identifier #define WM_JULIUS (WM_USER + 1) -// ????ID +// Event ID enum { JEVENT_ENGINE_ACTIVE, JEVENT_ENGINE_INACTIVE, Index: julius4/msvc/SampleApp/SampleApp.rc diff -u julius4/msvc/SampleApp/SampleApp.rc:1.1 julius4/msvc/SampleApp/SampleApp.rc:1.2 --- julius4/msvc/SampleApp/SampleApp.rc:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/SampleApp.rc Thu Oct 22 20:02:41 2009 @@ -1,11 +1,11 @@ -//Microsoft Visual C++ ?????????? ???????? +//This is a resource script generated by Microsoft Visual C++ // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // -// TEXTINCLUDE 2 ?????????????? +// Generated from TEXTINCLUDE 2 resources // #ifndef APSTUDIO_INVOKED #include "targetver.h" @@ -22,41 +22,41 @@ ///////////////////////////////////////////////////////////////////////////// // -// ???? +// Icons // -// ???????????????????????????????A?????-// ID ??????????z?????? +// In order to allocate an application icon in all systems, the icon +// with the smallest ID value will be placed first. -IDI_SAMPLEAPP ICON "SampleApp.ico" -IDI_SMALL ICON "small.ico" +// IDI_SAMPLEAPP ICON "SampleApp.ico" +// IDI_SMALL ICON "small.ico" ///////////////////////////////////////////////////////////////////////////// // -// ???? +// Menu // IDC_SAMPLEAPP MENU BEGIN - POPUP "????(&F)" + POPUP "File (&F)" BEGIN - MENUITEM "???????????&X)", IDM_EXIT + MENUITEM "Quit (&X)", IDM_EXIT END - POPUP "??(&M)" + POPUP "Command (&M)" BEGIN - MENUITEM "?Ž¯??", IDM_PAUSE - MENUITEM "?Ž¯??", IDM_RESUME + MENUITEM "Pause recognition", IDM_PAUSE + MENUITEM "Resume recognition", IDM_RESUME END - POPUP "???(&H)" + POPUP "Help (&H)" BEGIN - MENUITEM "???????&A)...", IDM_ABOUT + MENUITEM "About (&A)...", IDM_ABOUT END END ///////////////////////////////////////////////////////////////////////////// // -// ??????? +// Accelerators // IDC_SAMPLEAPP ACCELERATORS @@ -68,13 +68,13 @@ ///////////////////////////////////////////////////////////////////////////// // -// ????? +// Dialog // IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "???????SampleApp" -FONT 9, "MS UI Gothic" +CAPTION "About SampleApp" +//FONT 9, "MS UI Gothic" BEGIN ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20 LTEXT "SampleApp, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX @@ -131,7 +131,7 @@ ///////////////////////////////////////////////////////////////////////////// // -// ????? ???? +// String table // STRINGTABLE @@ -148,8 +148,8 @@ #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // -// TEXTINCLUDE 3 ?????????????? +// Generated from TEXTINCLUDE 3 resources // ///////////////////////////////////////////////////////////////////////////// -#endif // APSTUDIO_INVOKED ?????+#endif // not APSTUDIO_INVOKED Index: julius4/msvc/SampleApp/SampleApp.vcproj diff -u julius4/msvc/SampleApp/SampleApp.vcproj:1.1 julius4/msvc/SampleApp/SampleApp.vcproj:1.2 --- julius4/msvc/SampleApp/SampleApp.vcproj:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/SampleApp.vcproj Thu Oct 22 20:02:41 2009 @@ -246,10 +246,6 @@ RelativePath=".\SampleApp.rc" > - - Index: julius4/msvc/SampleApp/SampleApp.ico Index: julius4/msvc/SampleApp/small.ico From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 23:04:11 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 23:04:11 +0900 Subject: [Julius-cvs 475] CVS update: julius4/msvc Message-ID: <1256220251.196594.5862.nullmailer@users.sourceforge.jp> Index: julius4/msvc/00README.txt diff -u julius4/msvc/00README.txt:1.2 julius4/msvc/00README.txt:1.3 --- julius4/msvc/00README.txt:1.2 Thu Oct 22 02:06:49 2009 +++ julius4/msvc/00README.txt Thu Oct 22 23:04:11 2009 @@ -6,7 +6,14 @@ described here. See below to see how to compile Julius and test them. This package has been developed and tested on Visual C++ 2008 Express -Edition on Windows Vista 32bit/64bit. +Edition on Windows Vista 32bit/64bit, and Visual C++ 2008 Professional +on Windows XP. + + +You need an acoustic model and a language model to run Julius as +speech recognizer. You should also have a jconf configuration file. +Julius is not distirbuted with models. If you don't know what to do, +see the Julius Web for details. 1. Preparation @@ -23,52 +30,70 @@ The pre-compiled win32 libraries and header files are already included under the "zlib" and "portaudio" directory. -You need an acoustic model and a language model to run Julius as speech recognizer. -See the Julius Web for more details. +"SampleApp" requires acoustic model, language model and jconf file +that also works with Julius. The jconf file should be placed as +"default.jconf" in the same directory as "SampleApp.exe". 2. Compile =========== -Simply open the "JuliusLib.sln" file, and build it! -You will get "julius.exe" and "SampleApp.exe" under "Debug" or "Release" -directory. - -If you got an error when linking "zlib" or "portaudio", try compiling them -by your own. Get the sources, compile it, and then place all the .h and generated -.lib files under the corresponding directories, and rebuild Julius. If you have -re-compiled portaudio library, you may have to copy the generated portaudio DLL file -into the "Release" and "Debug" directories. +Simply open the "JuliusLib.sln" file, and build it! You will get +"julius.exe" and "SampleApp.exe" under "Debug" or "Release" directory. + +If you got an error when linking "zlib" or "portaudio", try compiling +them by your own. Get the sources, compile it, and then place all the +.h and generated .lib files under the corresponding directories, and +rebuild Julius. If you have re-compiled portaudio library, you may +have to copy the generated portaudio DLL file into the "Release" and +"Debug" directories. 3. Test ======== -! You need an acoustic model and a language model to run Julius as speech recognizer. -! See the Julius Web for more details. +You need an acoustic model and a language model to run Julius as +speech recognizer. You should also have a jconf configuration file. +Julius is not distirbuted with models. If you don't know what to do, +see the Julius Web for details. + +3.1 julius.exe +----------------- + +"julius.exe" is a console application, which runs as the same as the +distributed win32 version of Julius. You can run it from command +prompt with a working jconf file: + + % julius.exe -C xxx.jconf + +3.2 SampleApp.exe +------------------- -"julius.exe" is a console application, which just runs as the same as the normal win32 version. +"SampleApp.exe" is a sample GUI application which runs Julius engine +and dump each speech event to a main window. -The "SampleApp.exe" is a sample GUI application. Julius will start and the engine events will -be output to the main window. You can test it by the procedure below: +Before start, you should place a working jconf file as "default.jconf" +at the same directory as "SampleApp.exe". - a) Prepare an acoustic model, language model and jconf file for them. - b) Place a Jconf file as "fast.jconf" at the same directory as the exe. - c) Modify the locale setting at line 98 of SampleApp.cpp to match the - character encoding of your language model. - d) Recompile and Run it. +When SampleApp is run, the Julius engine will start inside as a +separate thread, and will send messages to the main window at each +speech event (trigger, recognition result, etc.). -The Julius output log will be stored in a text file "juliuslog.txt". +If you have some trouble displaying the results, try modifying the +locale setting at line 98 of SampleApp.cpp to match your language +model and re-compile. +The Julius enging output will be stored in a text file "juliuslog.txt". +Please check it if you encounter engine error. 4. The Julius Class ==================== -SampleApp uses a simple class definition "Julius.cpp" and "Julius.h". -They defines a wrapper class named "cJulius" that handles speech -recognition in a standard Windows messaging style. You can try to -use it like this: +A simple class definition "Julius.cpp" and "Julius.h" is used in +SampleApp. They defines a wrapper class named "cJulius" that utilizes +JuliusLib functions in Windows messaging style. You can use it in +your application like this: ----------------------------------------------------------------- #include "Julius.h" From sumomo ¡÷ users.sourceforge.jp Thu Oct 22 23:04:11 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Thu, 22 Oct 2009 23:04:11 +0900 Subject: [Julius-cvs 476] CVS update: julius4/msvc/SampleApp Message-ID: <1256220251.281116.5874.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/SampleApp.cpp diff -u julius4/msvc/SampleApp/SampleApp.cpp:1.1 julius4/msvc/SampleApp/SampleApp.cpp:1.2 --- julius4/msvc/SampleApp/SampleApp.cpp:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/SampleApp.cpp Thu Oct 22 23:04:11 2009 @@ -5,6 +5,9 @@ #include "SampleApp.h" #include "Julius.h" +// The jconf file name to load +#define JCONFFILE "default.jconf" + // Use a Julius class cJulius julius; @@ -129,10 +132,12 @@ switch (message) { case WM_CREATE: - if (! julius.initialize("fast.jconf") ) { - MessageBox(hWnd, L"failed to initialize", L"Error", MB_OK); + // initialize Julius engine to prepare for recognition + if (! julius.initialize( JCONFFILE ) ) { + MessageBox(hWnd, L"Error while loading Julius engine.\n\"default.jconf\" is missing or some configurations are wrong\n", L"Error", MB_OK); break; } + // start recognition if (! julius.startProcess(hWnd)) { MessageBox(hWnd, L"failed to start process", L"Error", MB_OK); } @@ -228,4 +233,4 @@ TextOut(hdc , 10 , 10 + line * 20, str, lstrlen(str)); ReleaseDC(hWnd , hdc); if (++line > 22) line = 0; -} \ No newline at end of file +} From sumomo ¡÷ users.sourceforge.jp Fri Oct 23 09:29:00 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 23 Oct 2009 09:29:00 +0900 Subject: [Julius-cvs 477] CVS update: julius4/msvc/SampleApp Message-ID: <1256257740.679545.708.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/Julius.cpp diff -u julius4/msvc/SampleApp/Julius.cpp:1.2 julius4/msvc/SampleApp/Julius.cpp:1.3 --- julius4/msvc/SampleApp/Julius.cpp:1.2 Thu Oct 22 20:02:41 2009 +++ julius4/msvc/SampleApp/Julius.cpp Fri Oct 23 09:29:00 2009 @@ -336,6 +336,9 @@ //================================================== void cJulius::stopProcess( void ) { + + if ( ! m_recog ) return; + if (m_opened) { // recognition thread will exit when audio input is closed j_close_stream(m_recog); @@ -348,6 +351,7 @@ //=================== void cJulius::pause( void ) { + if ( ! m_recog ) return; // request library to pause // After pause, the recognition thread will issue pause event // and then enter callback_wait_for_resume(), where thread will pause. @@ -359,6 +363,7 @@ //==================== void cJulius::resume( void ) { + if ( ! m_recog ) return; // request library to resume j_request_resume(m_recog); // resume the recognition thread @@ -372,6 +377,8 @@ { boolean ret; + if ( ! m_recog ) return false; + // load grammar switch( r->lmvar ) { case LM_DFA_WORD: @@ -406,9 +413,13 @@ { WORD_INFO *winfo; DFA_INFO *dfa; - RecogProcess *r = m_recog->process_list; + RecogProcess *r; boolean ret; + if ( ! m_recog ) return false; + + r = m_recog->process_list; + // load grammar switch( r->lmvar ) { case LM_DFA_WORD: @@ -452,6 +463,7 @@ //============== bool cJulius::changeGrammar( char *name, char *dictfile, char *dfafile ) { + if ( ! m_recog ) return false; return addGrammar(name, dictfile, dfafile, true); } @@ -460,9 +472,13 @@ //============================ bool cJulius::deleteGrammar( char *name ) { - RecogProcess *r = m_recog->process_list; + RecogProcess *r; int gid; + if ( ! m_recog ) return false; + + r = m_recog->process_list; + gid = multigram_get_id_by_name(r->lm, name); if (gid == -1) return false; @@ -483,10 +499,14 @@ //================================ bool cJulius::deactivateGrammar( char *name ) { - RecogProcess *r = m_recog->process_list; + RecogProcess *r; int gid; int ret; + if ( ! m_recog ) return false; + + r = m_recog->process_list; + gid = multigram_get_id_by_name(r->lm, name); if (gid == -1) return false; @@ -510,10 +530,14 @@ //================================= bool cJulius::activateGrammar( char *name ) { - RecogProcess *r = m_recog->process_list; + RecogProcess *r; int gid; int ret; + if ( ! m_recog ) return false; + + r = m_recog->process_list; + gid = multigram_get_id_by_name(r->lm, name); if (gid == -1) return false; @@ -537,6 +561,9 @@ //===================================== void cJulius::release( void ) { + + if ( ! m_recog ) return; + stopProcess(); if (m_threadHandle) { From sumomo ¡÷ users.sourceforge.jp Fri Oct 23 09:31:12 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 23 Oct 2009 09:31:12 +0900 Subject: [Julius-cvs 478] CVS update: julius4/msvc/SampleApp Message-ID: <1256257872.949825.3571.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/SampleApp.cpp diff -u julius4/msvc/SampleApp/SampleApp.cpp:1.2 julius4/msvc/SampleApp/SampleApp.cpp:1.3 --- julius4/msvc/SampleApp/SampleApp.cpp:1.2 Thu Oct 22 23:04:11 2009 +++ julius4/msvc/SampleApp/SampleApp.cpp Fri Oct 23 09:31:12 2009 @@ -5,9 +5,6 @@ #include "SampleApp.h" #include "Julius.h" -// The jconf file name to load -#define JCONFFILE "default.jconf" - // Use a Julius class cJulius julius; @@ -117,6 +114,40 @@ } // +// Function: GetJconfFileName( char *, int ) +// +// Open file dialog to get jconf file name +// +#include "CommDlg.h" +bool GetJconfFileName( char *buf, int buflen ) +{ + wchar_t wszFileName[MAX_PATH]; + bool ret; + static OPENFILENAME ofn; + + ZeroMemory( &wszFileName, sizeof(wchar_t) * MAX_PATH ); + ZeroMemory( &ofn, sizeof(OPENFILENAME) ); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = NULL; + ofn.lpstrFilter = L"Jconf File(*.jconf)\0*.jconf\0\0"; + ofn.lpstrFile = wszFileName; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + ofn.lpstrDefExt = L"jconf"; + ofn.lpstrTitle = L"Open Jconf"; + + if( GetOpenFileName( &ofn ) ) { + // convert wide-char to multi-byte char (limitation of JuliusLib...) + size_t converted = 0; + wcstombs_s(&converted, buf, buflen, wszFileName, _TRUNCATE); + ret = true; + } else { + ret = false; + } + return ret; +} + +// // Function: WndProc(HWND, UINT, WPARAM, LPARAM) // // Process messages received at the main window @@ -128,19 +159,11 @@ HDC hdc; int jEventId; int jResultId; + static char conffile[1024]; switch (message) { case WM_CREATE: - // initialize Julius engine to prepare for recognition - if (! julius.initialize( JCONFFILE ) ) { - MessageBox(hWnd, L"Error while loading Julius engine.\n\"default.jconf\" is missing or some configurations are wrong\n", L"Error", MB_OK); - break; - } - // start recognition - if (! julius.startProcess(hWnd)) { - MessageBox(hWnd, L"failed to start process", L"Error", MB_OK); - } break; case WM_JULIUS: jEventId = LOWORD(wParam); @@ -175,18 +198,43 @@ wmEvent = HIWORD(wParam); switch (wmId) { - case IDM_ABOUT: - DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + case IDM_OPENJCONF: + // (re-)open jconf file and prepare for recognition + if (GetJconfFileName( conffile, 1024 )) { + // initialize Julius engine to prepare for recognition + DebugOut(hWnd, L"Loading Julius Engine..."); + if (! julius.initialize( conffile ) ) { + MessageBox(hWnd, L"Error while loading Julius engine.\n", L"Error", MB_OK); + break; + } + DebugOut(hWnd, L"Done."); + DebugOut(hWnd, L"Do [Command]-[Start] to start recognition."); + } break; - case IDM_EXIT: - DestroyWindow(hWnd); + case IDM_STARTPROCESS: + // open audio stream and start recognition thread + if (! julius.startProcess(hWnd)) { + MessageBox(hWnd, L"failed to start process", L"Error", MB_OK); + } + break; + case IDM_STOPPROCESS: + // close audio stream and finish recognition thread + julius.stopProcess(); break; case IDM_PAUSE: + // pause engine julius.pause(); break; case IDM_RESUME: + // resume paused engine julius.resume(); break; + case IDM_ABOUT: + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + break; + case IDM_EXIT: + DestroyWindow(hWnd); + break; default: return DefWindowProc(hWnd, message, wParam, lParam); } @@ -196,7 +244,6 @@ EndPaint(hWnd, &ps); break; case WM_DESTROY: - julius.stopProcess(); PostQuitMessage(0); break; default: Index: julius4/msvc/SampleApp/Resource.h diff -u julius4/msvc/SampleApp/Resource.h:1.1 julius4/msvc/SampleApp/Resource.h:1.2 --- julius4/msvc/SampleApp/Resource.h:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/Resource.h Fri Oct 23 09:31:12 2009 @@ -18,8 +18,11 @@ #define IDC_STATIC -1 #endif -#define IDM_PAUSE 32771 -#define IDM_RESUME 32772 +#define IDM_OPENJCONF 32771 +#define IDM_STARTPROCESS 32772 +#define IDM_STOPPROCESS 32773 +#define IDM_PAUSE 32774 +#define IDM_RESUME 32775 // ??????????????? // @@ -28,7 +31,7 @@ #define _APS_NO_MFC 130 #define _APS_NEXT_RESOURCE_VALUE 129 -#define _APS_NEXT_COMMAND_VALUE 32773 +#define _APS_NEXT_COMMAND_VALUE 32776 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 110 #endif Index: julius4/msvc/SampleApp/SampleApp.rc diff -u julius4/msvc/SampleApp/SampleApp.rc:1.2 julius4/msvc/SampleApp/SampleApp.rc:1.3 --- julius4/msvc/SampleApp/SampleApp.rc:1.2 Thu Oct 22 20:02:41 2009 +++ julius4/msvc/SampleApp/SampleApp.rc Fri Oct 23 09:31:12 2009 @@ -40,12 +40,15 @@ BEGIN POPUP "File (&F)" BEGIN + MENUITEM "Open Jconf... (&O)", IDM_OPENJCONF MENUITEM "Quit (&X)", IDM_EXIT END POPUP "Command (&M)" BEGIN - MENUITEM "Pause recognition", IDM_PAUSE - MENUITEM "Resume recognition", IDM_RESUME + MENUITEM "Start", IDM_STARTPROCESS + MENUITEM "Finish", IDM_STOPPROCESS + MENUITEM "Pause", IDM_PAUSE + MENUITEM "Resume", IDM_RESUME END POPUP "Help (&H)" BEGIN From sumomo ¡÷ users.sourceforge.jp Fri Oct 23 09:31:49 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 23 Oct 2009 09:31:49 +0900 Subject: [Julius-cvs 479] CVS update: julius4/msvc/SampleApp Message-ID: <1256257909.566857.3938.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/stdafx.h diff -u julius4/msvc/SampleApp/stdafx.h:1.1 julius4/msvc/SampleApp/stdafx.h:1.2 --- julius4/msvc/SampleApp/stdafx.h:1.1 Thu Oct 22 01:47:20 2009 +++ julius4/msvc/SampleApp/stdafx.h Fri Oct 23 09:31:49 2009 @@ -5,6 +5,10 @@ #pragma once +// Windows XP ??????????????? +#define WINVER 0x0500 +#define _WIN32_WINNT 0x0500 + #include "targetver.h" #define WIN32_LEAN_AND_MEAN // Windows ??????????????????O???? @@ -19,4 +23,4 @@ // TODO: ???????????????????????????B -#include \ No newline at end of file +#include From sumomo ¡÷ users.sourceforge.jp Fri Oct 23 09:58:22 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Fri, 23 Oct 2009 09:58:22 +0900 Subject: [Julius-cvs 480] CVS update: julius4/libsent/include/sent Message-ID: <1256259502.940109.4490.nullmailer@users.sourceforge.jp> Index: julius4/libsent/include/sent/stddefs.h diff -u julius4/libsent/include/sent/stddefs.h:1.5 julius4/libsent/include/sent/stddefs.h:1.6 --- julius4/libsent/include/sent/stddefs.h:1.5 Sun Sep 20 23:02:40 2009 +++ julius4/libsent/include/sent/stddefs.h Fri Oct 23 09:58:22 2009 @@ -29,7 +29,7 @@ * @author Akinobu LEE * @date Sat Feb 12 11:49:37 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ /* @@ -123,6 +123,7 @@ #define getpid _getpid #define vsnprintf _vsnprintf #define snprintf _snprintf +#define strdup _strdup #endif #ifndef R_OK From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 03:43:38 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 03:43:38 +0900 Subject: [Julius-cvs 481] CVS update: julius4/libsent Message-ID: <1256582618.117660.25604.nullmailer@users.sourceforge.jp> Index: julius4/libsent/configure diff -u julius4/libsent/configure:1.16 julius4/libsent/configure:1.17 --- julius4/libsent/configure:1.16 Thu Oct 22 01:39:40 2009 +++ julius4/libsent/configure Tue Oct 27 03:43:37 2009 @@ -2214,7 +2214,88 @@ # if default is portaudio, guess WinMM / DirectSound / OSS / Solaris case $altype in portaudio) - case "$host_os" in + pa_system=no + echo $ac_n "checking for Pa_Initialize in -lportaudio""... $ac_c" 1>&6 +echo "configure:2220: checking for Pa_Initialize in -lportaudio" >&5 +ac_lib_var=`echo portaudio'_'Pa_Initialize | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lportaudio $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + for ac_hdr in portaudio.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2258: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +else + echo "$ac_t""no" 1>&6 +fi + + if test "$pa_system" = no; then + case "$host_os" in linux*) altype="pa-oss" ;; @@ -2223,7 +2304,7 @@ ;; cygwin*|mingw*) echo $ac_n "checking for main in -ldsound""... $ac_c" 1>&6 -echo "configure:2227: checking for main in -ldsound" >&5 +echo "configure:2308: checking for main in -ldsound" >&5 ac_lib_var=`echo dsound'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2231,14 +2312,14 @@ ac_save_LIBS="$LIBS" LIBS="-ldsound $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2257,17 +2338,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2261: checking for $ac_hdr" >&5 +echo "configure:2342: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2300,7 +2381,10 @@ fi ;; - esac + esac + else + altype="libportaudio" + fi ;; esac @@ -2338,7 +2422,7 @@ case "$host_os" in linux*) echo $ac_n "checking for spInitAudio in -lspa.linux""... $ac_c" 1>&6 -echo "configure:2342: checking for spInitAudio in -lspa.linux" >&5 +echo "configure:2426: checking for spInitAudio in -lspa.linux" >&5 ac_lib_var=`echo spa.linux'_'spInitAudio | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2346,7 +2430,7 @@ ac_save_LIBS="$LIBS" LIBS="-lspa.linux -lspb.linux -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2376,7 +2460,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for spInitAudio in -lspa.linux-glibc""... $ac_c" 1>&6 -echo "configure:2380: checking for spInitAudio in -lspa.linux-glibc" >&5 +echo "configure:2464: checking for spInitAudio in -lspa.linux-glibc" >&5 ac_lib_var=`echo spa.linux-glibc'_'spInitAudio | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2384,7 +2468,7 @@ ac_save_LIBS="$LIBS" LIBS="-lspa.linux-glibc -lspb.linux-glibc -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2436,8 +2520,13 @@ ;; esac ;; + libportaudio) + aldesc="PortAudio library (external)" + ADINOBJ="$ADINOBJ src/adin/adin_portaudio.o" + SOUNDLIB="$SOUNDLIB -lportaudio" + ;; pa-*) - aldesc="PortAudio library" + aldesc="PortAudio library (internal)" ADINOBJ="$ADINOBJ src/adin/pa/pa_lib.o src/adin/pa/pa_convert.o src/adin/pa/pa_trace.o src/adin/pa/pablio.o src/adin/pa/ringbuffer.o" SOUNDINC="-Isrc/adin/pa" cat >> confdefs.h <<\EOF @@ -2562,21 +2651,21 @@ if test "$with_netaudio_dir" = auto ; then echo $ac_n "checking for DatLink/NetAudio support""... $ac_c" 1>&6 -echo "configure:2566: checking for DatLink/NetAudio support" >&5 +echo "configure:2655: checking for DatLink/NetAudio support" >&5 else echo $ac_n "checking for DatLink/NetAudio support on ${with_netaudio_dir}""... $ac_c" 1>&6 -echo "configure:2569: checking for DatLink/NetAudio support on ${with_netaudio_dir}" >&5 +echo "configure:2658: checking for DatLink/NetAudio support on ${with_netaudio_dir}" >&5 fi TMPCPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I${with_netaudio_dir}/include" use_netaudio=no cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2601,7 +2690,7 @@ have_zlib=no; if test "$use_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:2605: checking for deflate in -lz" >&5 +echo "configure:2694: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2609,7 +2698,7 @@ ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2639,17 +2728,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2643: checking for $ac_hdr" >&5 +echo "configure:2732: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2694,7 +2783,7 @@ # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2698: checking for $ac_word" >&5 +echo "configure:2787: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2741,7 +2830,7 @@ if test "$with_sndfile" = yes; then have_libsndfile=no echo $ac_n "checking for sf_open in -lsndfile""... $ac_c" 1>&6 -echo "configure:2745: checking for sf_open in -lsndfile" >&5 +echo "configure:2834: checking for sf_open in -lsndfile" >&5 ac_lib_var=`echo sndfile'_'sf_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2749,7 +2838,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsndfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2779,17 +2868,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2783: checking for $ac_hdr" >&5 +echo "configure:2872: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2831,7 +2920,7 @@ if test "$have_libsndfile" = no; then echo $ac_n "checking for sf_open_read in -lsndfile""... $ac_c" 1>&6 -echo "configure:2835: checking for sf_open_read in -lsndfile" >&5 +echo "configure:2924: checking for sf_open_read in -lsndfile" >&5 ac_lib_var=`echo sndfile'_'sf_open_read | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2839,7 +2928,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsndfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2869,17 +2958,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2873: checking for $ac_hdr" >&5 +echo "configure:2962: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* Index: julius4/libsent/configure.in diff -u julius4/libsent/configure.in:1.16 julius4/libsent/configure.in:1.17 --- julius4/libsent/configure.in:1.16 Thu Oct 22 01:39:40 2009 +++ julius4/libsent/configure.in Tue Oct 27 03:43:37 2009 @@ -3,7 +3,7 @@ dnl Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology dnl All rights reserved dnl -dnl $Id: configure.in,v 1.16 2009/10/21 16:39:40 sumomo Exp $ +dnl $Id: configure.in,v 1.17 2009/10/26 18:43:37 sumomo Exp $ dnl dnl Process this file with autoconf to produce a configure script. @@ -237,7 +237,10 @@ # if default is portaudio, guess WinMM / DirectSound / OSS / Solaris case $altype in portaudio) - case "$host_os" in + pa_system=no + AC_CHECK_LIB(portaudio,Pa_Initialize,AC_CHECK_HEADERS(portaudio.h, pa_system=yes)) + if test "$pa_system" = no; then + case "$host_os" in linux*) altype="pa-oss" ;; @@ -251,7 +254,10 @@ altype="pa-winmm"), altype="pa-winmm") ;; - esac + esac + else + altype="libportaudio" + fi ;; esac @@ -307,8 +313,13 @@ ;; esac ;; + libportaudio) + aldesc="PortAudio library (external)" + ADINOBJ="$ADINOBJ src/adin/adin_portaudio.o" + SOUNDLIB="$SOUNDLIB -lportaudio" + ;; pa-*) - aldesc="PortAudio library" + aldesc="PortAudio library (internal)" ADINOBJ="$ADINOBJ src/adin/pa/pa_lib.o src/adin/pa/pa_convert.o src/adin/pa/pa_trace.o src/adin/pa/pablio.o src/adin/pa/ringbuffer.o" SOUNDINC="-Isrc/adin/pa" AC_DEFINE(USE_MIC) From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 03:43:38 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 03:43:38 +0900 Subject: [Julius-cvs 482] CVS update: julius4/libsent/src/adin Message-ID: <1256582618.187313.25613.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/adin/adin_portaudio.c diff -u julius4/libsent/src/adin/adin_portaudio.c:1.7 julius4/libsent/src/adin/adin_portaudio.c:1.8 --- julius4/libsent/src/adin/adin_portaudio.c:1.7 Thu Oct 22 01:39:40 2009 +++ julius4/libsent/src/adin/adin_portaudio.c Tue Oct 27 03:43:38 2009 @@ -44,7 +44,7 @@ * @author Akinobu LEE * @date Mon Feb 14 12:03:48 2005 * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * */ /* @@ -216,6 +216,9 @@ buffer_overflowed = FALSE; /* set buffer parameter*/ + frames_per_buffer = 256; + +#ifdef OLDVER if ((p = getenv("LATENCY_MSEC")) != NULL) { latency = atoi(p); jlog("Stat: adin_portaudio: set latency to %d msec (obtained from LATENCY_MSEC)\n", latency); @@ -223,13 +226,13 @@ latency = MAX_FRAGMENT_MSEC; jlog("Stat: adin_portaudio: set latency to %d msec\n", latency); } - frames_per_buffer = 256; num_buffer = sfreq * latency / (frames_per_buffer * 1000); 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)); +#endif /* initialize device and open stream */ err = Pa_Initialize(); @@ -244,39 +247,64 @@ // 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; + int devId; + PaDeviceIndex numDevice = Pa_GetDeviceCount(), i; + const PaDeviceInfo *deviceInfo; + const PaHostApiInfo *apiInfo; PaStreamParameters param; + char *devname; + static char buf[256]; +#ifdef _WIN32 + // at win32, force prefer order to ASIO > DirectSound > MME int iMME = -1, iDS = -1, iASIO = -1, iOther = -1; +#endif + + devname = getenv("PORTAUDIO_DEV"); + devId = -1; + jlog("Stat: adin_portaudio: input devices:\n"); for(i=0;imaxInputChannels <= 0) continue; apiInfo = Pa_GetHostApiInfo(deviceInfo->hostApi); + if (!apiInfo) continue; + snprintf(buf, 255, "%s: %s", apiInfo->name, deviceInfo->name); + buf[255] = '\0'; + jlog(" #%d [%s]\n", i+1, buf); + if (devname && strmatch(devname, buf)) { + devId = i; + } +#ifdef _WIN32 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; } +#endif } - 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 + if (devId != -1) { + jlog(" --> #%d matches PORTAUDIO_DEV, use it\n", devId + 1); + } +#ifdef _WIN32 + if (devId == -1) { + if (iASIO >= 0) devId = iASIO; + else if (iDS >= 0) devId = iDS; + else if (iMME >= 0) devId = iMME; + else devId = -1; + } +#endif + if (devId == -1) { + devId = Pa_GetDefaultInputDevice(); + } + deviceInfo = Pa_GetDeviceInfo(devId); + apiInfo = Pa_GetHostApiInfo(deviceInfo->hostApi); + snprintf(buf, 255, "%s: %s", apiInfo->name, deviceInfo->name); + buf[255] = '\0'; + jlog("Stat: adin_portaudio: selected: [%s]\n", buf); + jlog("Stat: adin_portaudio: set \"PORTAUDIO_DEV\" to the string in \"[]\" above to change\n"); + + if (devId == -1) { err = Pa_OpenDefaultStream(&stream, 1, 0, paInt16, sfreq, frames_per_buffer, Callback, NULL); @@ -284,6 +312,20 @@ jlog("Error: adin_portaudio: error in opening stream: %s\n", Pa_GetErrorText(err)); return(FALSE); } + } else { + memset( ¶m, 0, sizeof(param)); + param.channelCount = 1; + param.device = devId; + param.sampleFormat = paInt16; + param.suggestedLatency = Pa_GetDeviceInfo(devId)->defaultLowInputLatency; + jlog("Stat: adin_portaudio: setting the lowest latency: %.0f ms\n", param.suggestedLatency * 1000.0); + err = Pa_OpenStream(&stream, ¶m, NULL, sfreq, + frames_per_buffer, paNoFlag, + Callback, NULL); + if (err != paNoError) { + jlog("Error: adin_portaudio: error in opening stream: %s\n", Pa_GetErrorText(err)); + return(FALSE); + } } } From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 13:31:21 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 13:31:21 +0900 Subject: [Julius-cvs 483] CVS update: julius4/libsent Message-ID: <1256617881.846702.22500.nullmailer@users.sourceforge.jp> Index: julius4/libsent/configure diff -u julius4/libsent/configure:1.17 julius4/libsent/configure:1.18 --- julius4/libsent/configure:1.17 Tue Oct 27 03:43:37 2009 +++ julius4/libsent/configure Tue Oct 27 13:31:21 2009 @@ -2524,6 +2524,10 @@ aldesc="PortAudio library (external)" ADINOBJ="$ADINOBJ src/adin/adin_portaudio.o" SOUNDLIB="$SOUNDLIB -lportaudio" + cat >> confdefs.h <<\EOF +#define USE_MIC 1 +EOF + ;; pa-*) aldesc="PortAudio library (internal)" @@ -2651,21 +2655,21 @@ if test "$with_netaudio_dir" = auto ; then echo $ac_n "checking for DatLink/NetAudio support""... $ac_c" 1>&6 -echo "configure:2655: checking for DatLink/NetAudio support" >&5 +echo "configure:2659: checking for DatLink/NetAudio support" >&5 else echo $ac_n "checking for DatLink/NetAudio support on ${with_netaudio_dir}""... $ac_c" 1>&6 -echo "configure:2658: checking for DatLink/NetAudio support on ${with_netaudio_dir}" >&5 +echo "configure:2662: checking for DatLink/NetAudio support on ${with_netaudio_dir}" >&5 fi TMPCPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I${with_netaudio_dir}/include" use_netaudio=no cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2690,7 +2694,7 @@ have_zlib=no; if test "$use_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:2694: checking for deflate in -lz" >&5 +echo "configure:2698: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2698,7 +2702,7 @@ ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2728,17 +2732,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2732: checking for $ac_hdr" >&5 +echo "configure:2736: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2783,7 +2787,7 @@ # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2787: checking for $ac_word" >&5 +echo "configure:2791: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2830,7 +2834,7 @@ if test "$with_sndfile" = yes; then have_libsndfile=no echo $ac_n "checking for sf_open in -lsndfile""... $ac_c" 1>&6 -echo "configure:2834: checking for sf_open in -lsndfile" >&5 +echo "configure:2838: checking for sf_open in -lsndfile" >&5 ac_lib_var=`echo sndfile'_'sf_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2838,7 +2842,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsndfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2868,17 +2872,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2872: checking for $ac_hdr" >&5 +echo "configure:2876: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2920,7 +2924,7 @@ if test "$have_libsndfile" = no; then echo $ac_n "checking for sf_open_read in -lsndfile""... $ac_c" 1>&6 -echo "configure:2924: checking for sf_open_read in -lsndfile" >&5 +echo "configure:2928: checking for sf_open_read in -lsndfile" >&5 ac_lib_var=`echo sndfile'_'sf_open_read | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2928,7 +2932,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsndfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2958,17 +2962,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2962: checking for $ac_hdr" >&5 +echo "configure:2966: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* Index: julius4/libsent/configure.in diff -u julius4/libsent/configure.in:1.17 julius4/libsent/configure.in:1.18 --- julius4/libsent/configure.in:1.17 Tue Oct 27 03:43:37 2009 +++ julius4/libsent/configure.in Tue Oct 27 13:31:21 2009 @@ -3,7 +3,7 @@ dnl Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology dnl All rights reserved dnl -dnl $Id: configure.in,v 1.17 2009/10/26 18:43:37 sumomo Exp $ +dnl $Id: configure.in,v 1.18 2009/10/27 04:31:21 sumomo Exp $ dnl dnl Process this file with autoconf to produce a configure script. @@ -317,6 +317,7 @@ aldesc="PortAudio library (external)" ADINOBJ="$ADINOBJ src/adin/adin_portaudio.o" SOUNDLIB="$SOUNDLIB -lportaudio" + AC_DEFINE(USE_MIC) ;; pa-*) aldesc="PortAudio library (internal)" From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 13:31:21 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 13:31:21 +0900 Subject: [Julius-cvs 484] CVS update: julius4/libsent/src/adin Message-ID: <1256617881.982026.22530.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/adin/adin_portaudio.c diff -u julius4/libsent/src/adin/adin_portaudio.c:1.8 julius4/libsent/src/adin/adin_portaudio.c:1.9 --- julius4/libsent/src/adin/adin_portaudio.c:1.8 Tue Oct 27 03:43:38 2009 +++ julius4/libsent/src/adin/adin_portaudio.c Tue Oct 27 13:31:21 2009 @@ -44,7 +44,7 @@ * @author Akinobu LEE * @date Mon Feb 14 12:03:48 2005 * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * */ /* @@ -193,7 +193,10 @@ adin_mic_standby(int sfreq, void *dummy) { PaError err; - int frames_per_buffer, num_buffer; + int frames_per_buffer; +#ifdef OLDVER + int num_buffer; +#endif int latency; char *p; @@ -218,14 +221,14 @@ /* set buffer parameter*/ frames_per_buffer = 256; -#ifdef OLDVER if ((p = getenv("LATENCY_MSEC")) != NULL) { latency = atoi(p); - jlog("Stat: adin_portaudio: set latency to %d msec (obtained from LATENCY_MSEC)\n", latency); + jlog("Stat: adin_portaudio: setting latency to %d msec (obtained from LATENCY_MSEC)\n", latency); } else { latency = MAX_FRAGMENT_MSEC; - jlog("Stat: adin_portaudio: set latency to %d msec\n", latency); + jlog("Stat: adin_portaudio: setting latency to %d msec\n", latency); } +#ifdef OLDVER num_buffer = sfreq * latency / (frames_per_buffer * 1000); jlog("Stat: adin_portaudio: framesPerBuffer=%d, NumBuffers(guess)=%d\n", frames_per_buffer, num_buffer); @@ -262,7 +265,7 @@ devname = getenv("PORTAUDIO_DEV"); devId = -1; - jlog("Stat: adin_portaudio: input devices:\n"); + jlog("Stat: adin_portaudio: available capture devices:\n"); for(i=0;ihostApi); snprintf(buf, 255, "%s: %s", apiInfo->name, deviceInfo->name); buf[255] = '\0'; - jlog("Stat: adin_portaudio: selected: [%s]\n", buf); - jlog("Stat: adin_portaudio: set \"PORTAUDIO_DEV\" to the string in \"[]\" above to change\n"); + jlog("Stat: adin_portaudio: get input from: [%s]\n", buf); + jlog("Info: adin_portaudio: set \"PORTAUDIO_DEV\" to the string in \"[]\" above to change\n"); if (devId == -1) { err = Pa_OpenDefaultStream(&stream, 1, 0, paInt16, sfreq, @@ -317,8 +320,8 @@ param.channelCount = 1; param.device = devId; param.sampleFormat = paInt16; - param.suggestedLatency = Pa_GetDeviceInfo(devId)->defaultLowInputLatency; - jlog("Stat: adin_portaudio: setting the lowest latency: %.0f ms\n", param.suggestedLatency * 1000.0); + //param.suggestedLatency = Pa_GetDeviceInfo(devId)->defaultLowInputLatency; + param.suggestedLatency = latency / 1000.0; err = Pa_OpenStream(&stream, ¶m, NULL, sfreq, frames_per_buffer, paNoFlag, Callback, NULL); @@ -327,6 +330,11 @@ return(FALSE); } } + { + const PaStreamInfo *stinfo; + stinfo = Pa_GetStreamInfo(stream); + jlog("Stat: adin_portaudio: latency was set to %.0f msec\n", stinfo->inputLatency * 1000.0); + } } #else From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 14:06:25 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 14:06:25 +0900 Subject: [Julius-cvs 485] CVS update: julius4/libsent/src/wav2mfcc Message-ID: <1256619985.913506.12361.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/wav2mfcc/wav2mfcc-buffer.c diff -u julius4/libsent/src/wav2mfcc/wav2mfcc-buffer.c:1.4 julius4/libsent/src/wav2mfcc/wav2mfcc-buffer.c:1.5 --- julius4/libsent/src/wav2mfcc/wav2mfcc-buffer.c:1.4 Tue Jun 17 10:20:51 2008 +++ julius4/libsent/src/wav2mfcc/wav2mfcc-buffer.c Tue Oct 27 14:06:25 2009 @@ -24,7 +24,7 @@ * @author Akinobu LEE * @date Thu Feb 17 17:43:35 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ @@ -94,7 +94,7 @@ if (para->acc) Accel(mfcc, frame_num, para); /* Cepstrum Mean and/or Variance Normalization */ - if (para->cmn && ! para->cvn) CMN(mfcc, frame_num, para->mfcc_dim + (para->c0 ? 1 : 0)); + if (para->cmn && ! para->cvn) CMN(mfcc, frame_num, para->mfcc_dim); else if (para->cmn || para->cvn) MVN(mfcc, frame_num, para); return(frame_num); @@ -252,7 +252,7 @@ float x; int basedim; - basedim = para->mfcc_dim + (para->c0 ? 1 : 0); + basedim = para->mfcc_dim; // + (para->c0 ? 1 : 0); mfcc_mean = (float *)mycalloc(para->veclen, sizeof(float)); if (para->cvn) mfcc_sd = (float *)mycalloc(para->veclen, sizeof(float)); Index: julius4/libsent/src/wav2mfcc/wav2mfcc-pipe.c diff -u julius4/libsent/src/wav2mfcc/wav2mfcc-pipe.c:1.4 julius4/libsent/src/wav2mfcc/wav2mfcc-pipe.c:1.5 --- julius4/libsent/src/wav2mfcc/wav2mfcc-pipe.c:1.4 Fri May 15 12:22:53 2009 +++ julius4/libsent/src/wav2mfcc/wav2mfcc-pipe.c Tue Oct 27 14:06:25 2009 @@ -20,7 +20,7 @@ * @author Akinobu LEE * @date Thu Feb 17 18:12:30 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -253,7 +253,7 @@ c = (CMNWork *)mymalloc(sizeof(CMNWork)); c->cweight = weight; - c->mfcc_dim = para->mfcc_dim + (para->c0 ? 1 : 0); + c->mfcc_dim = para->mfcc_dim; // + (para->c0 ? 1 : 0); c->veclen = para->veclen; c->mean = para->cmn ? TRUE : FALSE; c->var = para->cvn ? TRUE : FALSE; From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 14:06:52 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 14:06:52 +0900 Subject: [Julius-cvs 486] CVS update: julius4/libjulius/src Message-ID: <1256620012.226843.12835.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/m_adin.c diff -u julius4/libjulius/src/m_adin.c:1.10 julius4/libjulius/src/m_adin.c:1.11 --- julius4/libjulius/src/m_adin.c:1.10 Fri Jul 3 02:05:20 2009 +++ julius4/libjulius/src/m_adin.c Tue Oct 27 14:06:52 2009 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Fri Mar 18 16:17:23 2005 * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * */ /* @@ -157,6 +157,7 @@ /* MFC_FILE is not waveform, so special handling on main routine should be done */ break; default: + jlog("Error: m_adin: unknown input ID\n"); return FALSE; } From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 14:54:29 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 14:54:29 +0900 Subject: [Julius-cvs 487] CVS update: julius4 Message-ID: <1256622869.146818.22106.nullmailer@users.sourceforge.jp> Index: julius4/00readme-ja.txt diff -u julius4/00readme-ja.txt:1.9 julius4/00readme-ja.txt:1.10 --- julius4/00readme-ja.txt:1.9 Wed Feb 11 18:14:13 2009 +++ julius4/00readme-ja.txt Tue Oct 27 14:54:28 2009 @@ -4,6 +4,7 @@ Julius + (Rev 4.1.3 2009/11/02) (Rev 4.1.2 2009/02/12) (Rev 4.1.1 2008/12/13) (Rev 4.1 2008/10/03) @@ -34,14 +35,16 @@ http://julius.sourceforge.jp/ -Julius-4.1.2 +Julius-4.1.3 ============= -????? 4.1.2 ?N-gram?????????????????D -2GB???T??? N-gram ?????SRILM ??????-gram?? -????????????????????????????? -???????????????????????s?????? +????? 4.1.3 ???Microsoft Visual C++ 2008 ?Julius?????? +???????????????????Julius ???????????? +??????????????????????????????????+?? msvc/00README.txt ???????? +???????? N-gram ??????portaudio ????V19????? +??????????????????????????s?????? ??????????Release-ja.txt ???????? @@ -76,10 +79,13 @@ ======================= ??????????????????????????????????? -jconf ?????????????????????(.man)???????? -??????? Julius ? Web ???????????????????? -??????????????????????????????????? -????????C?????????????????????????? +jconf ?????????????????????(.man)????? + +?????????? JuliusBook ?????????JuliusBook ???? +?????????? Julius ? Web ????????????????? +??????????????????????????????????? +???????????C??????????????????????? +??? ???????http://julius.sourceforge.jp/ Index: julius4/00readme.txt diff -u julius4/00readme.txt:1.8 julius4/00readme.txt:1.9 --- julius4/00readme.txt:1.8 Wed Feb 11 16:14:51 2009 +++ julius4/00readme.txt Tue Oct 27 14:54:28 2009 @@ -4,6 +4,7 @@ Julius + (Rev 4.1.3 2009/11/02) (Rev 4.1.2 2009/02/12) (Rev 4.1.1 2008/12/13) (Rev 4.1 2008/10/03) @@ -46,18 +47,21 @@ together with source codes. -What's new in Julius-4.1.2 +What's new in Julius-4.1.3 =========================== -Revision 4.1.2 includes many fixes for N-gram. -It now allows over 2GB N-gram, improved support for SRILM, and -correct handling of unknown words. Some bugs and improvements -that has been reported on the Forum has been also fixed. +This release has a new support for building Julius on Microsoft Visual +C++ 2008. A sample wrapper class that handles Julius engine is also +included, with a sample application. See "msvc/00README.txt" for +details. -see "Release.txt" for more details of changes. +It also support N-gram of arbitrary N, portaudio extension (V19 and +external library support) and many bug fixes. +see "Release.txt" for details of the changes. -Contents of Julius-4.1.2 + +Contents of Julius-4.1.3 ======================== (Documents with suffix "ja" are written in Japanese) @@ -84,6 +88,7 @@ jclient-perl/ A simple perl version of module mode client plugin/ Several plugin source codes and documentation man/ Unix online manuals + msvc/ Files to compile on Microsoft VC++ 2008 Documentation @@ -93,11 +98,6 @@ http://julius.sourceforge.jp/en/ -For QA, discussion and development information, please see and join -the Julius web forum at: - - http://julius.sourceforge.jp/forum/ - License ======== @@ -110,6 +110,12 @@ Contact Us =========== +For QA, discussion and development information, please see and join +the Julius web forum at: + + http://julius.sourceforge.jp/forum/ + + The contact address of Julius/Julian development team is: (please replace 'at' with '@') Index: julius4/Release-ja.txt diff -u julius4/Release-ja.txt:1.9 julius4/Release-ja.txt:1.10 --- julius4/Release-ja.txt:1.9 Wed Feb 11 16:14:51 2009 +++ julius4/Release-ja.txt Tue Oct 27 14:54:28 2009 @@ -1,3 +1,29 @@ +4.1.3 (2009.11.02) +=================== + +??? + - ??? MSVC ?????"msvc/00README.txt" ????????? + - ???? N-gram ????? + - ????? portaudio ??????????????Julius ??? + portaudio ??????????????????????????? + V19 ???????????A??????? PORTAUDIO_DEV ?????? + ???N??????????? + - ????????????????? (-walign) ????\? + +??????+ - 4.1.x ? 0?????????CMN???????4.0.x ???????? + ??????????? + - j_get_current_filename() ? JuliusLib ??? + - "--enable-wpair" ???????????? + +?????+ - ????????????????????o????+ - julius-simple ? make ?????????+ - cygwin ????????????+ - adintool ? "-server" ?????????+ - ??????Ž¯?????????????????+ + 4.1.2 (2009.02.12) =================== Index: julius4/Release.txt diff -u julius4/Release.txt:1.9 julius4/Release.txt:1.10 --- julius4/Release.txt:1.9 Wed Feb 11 16:14:51 2009 +++ julius4/Release.txt Tue Oct 27 14:54:28 2009 @@ -1,3 +1,30 @@ +4.1.3 (2009.11.02) +=================== + +New features: + - new MSVC support: please read "msvc/00README.txt" + - extended N-gram to support arbitrary N + - portaudio external library (V19) can be used instead of internal V18. + When configure detects portaudio library installed in your system, + Julius will use it instead of internal V18. You can also choose + input device by "PORTAUDIO_DEV" env. var. at V19library. See the + log text at start up to know how to set it. + - allow word alignment output (-walign) in module mode + +Modified: + - ! now Julius do not perform CMN on 0'th cepstral coefficients, + which is the same as the old 4.0.x versions. + - j_get_current_filename() added on JuliusLib + - improved "--enable-wpair" handling + +Bug fixes: + - many bugs around audio open/close API on JuliusLib + - fail to do make in julius-simple + - unable to record inputs at cygwin + - segfault on adintool with "-server" + - occasional segfault at grammar recognition + + 4.1.2 (2009.02.12) =================== From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 14:54:29 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 14:54:29 +0900 Subject: [Julius-cvs 488] CVS update: julius4/msvc Message-ID: <1256622869.309750.22115.nullmailer@users.sourceforge.jp> Index: julius4/msvc/00README.txt diff -u julius4/msvc/00README.txt:1.3 julius4/msvc/00README.txt:1.4 --- julius4/msvc/00README.txt:1.3 Thu Oct 22 23:04:11 2009 +++ julius4/msvc/00README.txt Tue Oct 27 14:54:29 2009 @@ -1,83 +1,75 @@ HOW TO COMPILE JULIUS ON MSVC / THE JULIUS CLASS ================================================= -This file explains how to compile Julius on Microsoft Visual C++ 2008. -A sample application "SampleApp" and the Julius wrapper class is also -described here. See below to see how to compile Julius and test them. - -This package has been developed and tested on Visual C++ 2008 Express -Edition on Windows Vista 32bit/64bit, and Visual C++ 2008 Professional -on Windows XP. - - -You need an acoustic model and a language model to run Julius as -speech recognizer. You should also have a jconf configuration file. -Julius is not distirbuted with models. If you don't know what to do, -see the Julius Web for details. +This file describes how to compile Julius on Microsoft Visual C++ +2008. A sample application "SampleApp" and the Julius wrapper class +is also included. See below to see how to compile and test it. + +The MSVC support has been developed and tested for MS Visual C++ 2008 +on both Professional and Express Edition, on Windows Vista +32bit/64bit and XP. + +If you are totally new to Julius, please note that an acoustic model +and a language model is needed to run Julius as speech recognizer. +You should also have a jconf configuration file to specify Julius +models and other option values. If you don't know what to do, learn +from the Julius Web for details. 1. Preparation =============== "Microsoft DirectX SDK" is required to compile Julius. -You can get it from the Microsoft Web. +You can get it from the Microsoft Web site. -Julius also uses these two open-source libraries: +Also, Julius uses these two open-source libraries: - zlib - portaudio (V19) -The pre-compiled win32 libraries and header files are already -included under the "zlib" and "portaudio" directory. - -"SampleApp" requires acoustic model, language model and jconf file -that also works with Julius. The jconf file should be placed as -"default.jconf" in the same directory as "SampleApp.exe". +The pre-compiled win32 libraries and header files are already included +under the "zlib" and "portaudio" directory. If they don't work on +your environment, compile them by yourself and replace the headers and +libraries under each directory. Also, please place the compiled +portaudio DLL to both "Release" and "Debug" directories. 2. Compile =========== -Simply open the "JuliusLib.sln" file, and build it! You will get -"julius.exe" and "SampleApp.exe" under "Debug" or "Release" directory. - -If you got an error when linking "zlib" or "portaudio", try compiling -them by your own. Get the sources, compile it, and then place all the -.h and generated .lib files under the corresponding directories, and -rebuild Julius. If you have re-compiled portaudio library, you may -have to copy the generated portaudio DLL file into the "Release" and -"Debug" directories. +Open "JuliusLib.sln" with MS VC++, and build it! You will get +libraries, "julius.exe" and "SampleApp.exe" under "Debug" or "Release" +directory. + +If you got an error when linking "zlib" or "portaudio", compile them +by yourself and replace the headers and libraries under each +directory. Also, please place the compiled portaudio DLL to both +"Release" and "Debug" directories. 3. Test ======== -You need an acoustic model and a language model to run Julius as -speech recognizer. You should also have a jconf configuration file. -Julius is not distirbuted with models. If you don't know what to do, -see the Julius Web for details. - 3.1 julius.exe ----------------- "julius.exe" is a console application, which runs as the same as the distributed win32 version of Julius. You can run it from command -prompt with a working jconf file: +prompt with a working jconf file, just the same way as the +pre-compiled win32 version: % julius.exe -C xxx.jconf 3.2 SampleApp.exe ------------------- -"SampleApp.exe" is a sample GUI application which runs Julius engine -and dump each speech event to a main window. - -Before start, you should place a working jconf file as "default.jconf" -at the same directory as "SampleApp.exe". +"SampleApp.exe" is a sample GUI version of Julius which uses a simple +Julius wrapper class and JuliusLib libraries. -When SampleApp is run, the Julius engine will start inside as a -separate thread, and will send messages to the main window at each -speech event (trigger, recognition result, etc.). +At SampleApp main window, open the jconf file you want to run. Then +the Julius engine will start inside as a separate thread, and will +send messages to the main window at each speech event (trigger, +recognition result, etc.). If you have some trouble displaying the results, try modifying the locale setting at line 98 of SampleApp.cpp to match your language From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 15:30:58 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 15:30:58 +0900 Subject: [Julius-cvs 489] CVS update: julius4/libjulius Message-ID: <1256625058.035037.6193.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/configure diff -u julius4/libjulius/configure:1.9 julius4/libjulius/configure:1.10 --- julius4/libjulius/configure:1.9 Wed Feb 11 16:22:44 2009 +++ julius4/libjulius/configure Tue Oct 27 15:30:57 2009 @@ -592,7 +592,7 @@ JULIUS_PRODUCTNAME=JuliusLib -JULIUS_VERSION=4.1.2 +JULIUS_VERSION=4.1.3 # Check whether --enable-pthread or --disable-pthread was given. Index: julius4/libjulius/configure.in diff -u julius4/libjulius/configure.in:1.9 julius4/libjulius/configure.in:1.10 --- julius4/libjulius/configure.in:1.9 Wed Feb 11 16:22:45 2009 +++ julius4/libjulius/configure.in Tue Oct 27 15:30:57 2009 @@ -4,7 +4,7 @@ dnl Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology dnl All rights reserved dnl -dnl $Id: configure.in,v 1.9 2009/02/11 07:22:45 sumomo Exp $ +dnl $Id: configure.in,v 1.10 2009/10/27 06:30:57 sumomo Exp $ dnl AC_INIT(src/search_bestfirst_main.c) @@ -12,7 +12,7 @@ AC_CONFIG_AUX_DIR(../support) JULIUS_PRODUCTNAME=JuliusLib -JULIUS_VERSION=4.1.2 +JULIUS_VERSION=4.1.3 dnl Checks for options From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 15:30:58 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 15:30:58 +0900 Subject: [Julius-cvs 490] CVS update: julius4/libsent Message-ID: <1256625058.113424.6204.nullmailer@users.sourceforge.jp> Index: julius4/libsent/configure diff -u julius4/libsent/configure:1.18 julius4/libsent/configure:1.19 --- julius4/libsent/configure:1.18 Tue Oct 27 13:31:21 2009 +++ julius4/libsent/configure Tue Oct 27 15:30:58 2009 @@ -563,7 +563,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. -LIBSENT_VERSION=4.1.2 +LIBSENT_VERSION=4.1.3 # specify mic type # Check whether --with-mictype or --without-mictype was given. Index: julius4/libsent/configure.in diff -u julius4/libsent/configure.in:1.18 julius4/libsent/configure.in:1.19 --- julius4/libsent/configure.in:1.18 Tue Oct 27 13:31:21 2009 +++ julius4/libsent/configure.in Tue Oct 27 15:30:58 2009 @@ -3,7 +3,7 @@ dnl Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology dnl All rights reserved dnl -dnl $Id: configure.in,v 1.18 2009/10/27 04:31:21 sumomo Exp $ +dnl $Id: configure.in,v 1.19 2009/10/27 06:30:58 sumomo Exp $ dnl dnl Process this file with autoconf to produce a configure script. @@ -11,7 +11,7 @@ AC_CONFIG_HEADER(include/sent/config.h) AC_CONFIG_AUX_DIR(../support) -LIBSENT_VERSION=4.1.2 +LIBSENT_VERSION=4.1.3 dnl Checks for options # specify mic type From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 15:30:58 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 15:30:58 +0900 Subject: [Julius-cvs 491] CVS update: julius4/support Message-ID: <1256625058.177371.6211.nullmailer@users.sourceforge.jp> Index: julius4/support/build-all.sh diff -u julius4/support/build-all.sh:1.7 julius4/support/build-all.sh:1.8 --- julius4/support/build-all.sh:1.7 Wed Feb 11 16:22:45 2009 +++ julius4/support/build-all.sh Tue Oct 27 15:30:58 2009 @@ -6,7 +6,7 @@ # # argument: any configure options except "--enable-setup=..." is allowed. # -JULIUS_VERSION=4.1.2 +JULIUS_VERSION=4.1.3 ###################################################################### From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 23:48:21 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 23:48:21 +0900 Subject: [Julius-cvs 492] CVS update: julius4/msvc/SampleApp Message-ID: <1256654901.734026.15988.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/Julius.cpp diff -u julius4/msvc/SampleApp/Julius.cpp:1.3 julius4/msvc/SampleApp/Julius.cpp:1.4 --- julius4/msvc/SampleApp/Julius.cpp:1.3 Fri Oct 23 09:29:00 2009 +++ julius4/msvc/SampleApp/Julius.cpp Tue Oct 27 23:48:21 2009 @@ -1,3 +1,13 @@ +/** + * + * cJulius: JuliusLib wrapper class for C++ + * + * Copyright (c) 2009 Julius project team, Nagoya Institute of Technology + * All rights reserved + * + * This is a part of the Julius software. + */ + #include #include "Julius.h" @@ -33,6 +43,7 @@ static wchar_t wstr[2048]; size_t size = 0; WPARAM wparam = 0; + _locale_t locale; r = j->getRecog()->process_list; if (! r->live) return; @@ -68,7 +79,11 @@ for(i=0;iwoutput[seq[i]]); // convert to wide char - mbstowcs_s( &size, wstr, str, strlen(str)+1); + //mbstowcs_s( &size, wstr, str, strlen(str)+1); + locale = j->getModelLocale(); + if (locale) _mbstowcs_s_l( &size, wstr, str, strlen(str)+1, locale); + else mbstowcs_s( &size, wstr, str, strlen(str)+1); + // set status parameter wparam = (r->result.status << 16) + JEVENT_RESULT_FINAL; @@ -111,7 +126,7 @@ //============= // Constructor //============= -cJulius::cJulius( void ) : m_jconf( NULL ), m_recog( NULL ), m_opened( false ), m_threadHandle( NULL ), m_fpLogFile( NULL ) +cJulius::cJulius( void ) : m_jconf( NULL ), m_recog( NULL ), m_opened( false ), m_threadHandle( NULL ), m_fpLogFile( NULL ), m_modelLocale( NULL ) { #ifdef APP_ADIN m_appsource = 0; @@ -199,6 +214,22 @@ } } +//====================== +// set locale of the LM +//====================== +void cJulius::setModelLocale( const char *locale ) +{ + m_modelLocale = _create_locale( LC_CTYPE, locale); +} + +//======================================== +// return current model locale for output +//======================================== +_locale_t cJulius::getModelLocale( void ) +{ + return( m_modelLocale ); +} + //======================== // Create engine instance //======================== @@ -302,11 +333,11 @@ if ( ! m_recog ) return false; - // ??????????? + // store window hanlder to send event message m_hWnd = hWnd; if (m_opened == false) { - // ??????? + // open device switch(j_open_stream(m_recog, NULL)) { case 0: /* succeeded */ break; @@ -317,7 +348,7 @@ //fprintf(stderr, "failed to begin input stream\n"); return false; } - // ??????? + // create recognition thread m_threadHandle = CreateThread(NULL, 0, ::recogThreadMain, (LPVOID)m_recog, 0, &m_threadId); if (m_threadHandle == NULL) { j_close_stream(m_recog); Index: julius4/msvc/SampleApp/Julius.h diff -u julius4/msvc/SampleApp/Julius.h:1.2 julius4/msvc/SampleApp/Julius.h:1.3 --- julius4/msvc/SampleApp/Julius.h:1.2 Thu Oct 22 20:02:41 2009 +++ julius4/msvc/SampleApp/Julius.h Tue Oct 27 23:48:21 2009 @@ -1,7 +1,18 @@ +/** + * + * cJulius: JuliusLib wrapper class for C++ + * + * Copyright (c) 2009 Julius project team, Nagoya Institute of Technology + * All rights reserved + * + * This is a part of the Julius software. + */ + #ifndef _JULIUSCLASS_H_ #define _JULIUSCLASS_H_ #include "julius/juliuslib.h" +#include "locale.h" // for development codes: do not define this #undef APP_ADIN @@ -38,6 +49,7 @@ HANDLE m_threadHandle; DWORD m_threadId; HWND m_hWnd; + _locale_t m_modelLocale; #ifdef APP_ADIN int m_appsource #endif From sumomo ¡÷ users.sourceforge.jp Tue Oct 27 23:56:58 2009 From: sumomo ¡÷ users.sourceforge.jp (sumomo ¡÷ users.sourceforge.jp) Date: Tue, 27 Oct 2009 23:56:58 +0900 Subject: [Julius-cvs 493] CVS update: julius4/msvc/SampleApp Message-ID: <1256655418.508065.27816.nullmailer@users.sourceforge.jp> Index: julius4/msvc/SampleApp/Julius.cpp diff -u julius4/msvc/SampleApp/Julius.cpp:1.4 julius4/msvc/SampleApp/Julius.cpp:1.5 --- julius4/msvc/SampleApp/Julius.cpp:1.4 Tue Oct 27 23:48:21 2009 +++ julius4/msvc/SampleApp/Julius.cpp Tue Oct 27 23:56:58 2009 @@ -1,12 +1,12 @@ -/** - * - * cJulius: JuliusLib wrapper class for C++ - * - * Copyright (c) 2009 Julius project team, Nagoya Institute of Technology - * All rights reserved - * - * This is a part of the Julius software. - */ +/** + * + * cJulius: JuliusLib wrapper class for C++ + * + * Copyright (c) 2009 Julius project team, Nagoya Institute of Technology + * All rights reserved + * + * This is a part of the Julius software. + */ #include #include "Julius.h" Index: julius4/msvc/SampleApp/Julius.h diff -u julius4/msvc/SampleApp/Julius.h:1.3 julius4/msvc/SampleApp/Julius.h:1.4 --- julius4/msvc/SampleApp/Julius.h:1.3 Tue Oct 27 23:48:21 2009 +++ julius4/msvc/SampleApp/Julius.h Tue Oct 27 23:56:58 2009 @@ -1,12 +1,12 @@ -/** - * - * cJulius: JuliusLib wrapper class for C++ - * - * Copyright (c) 2009 Julius project team, Nagoya Institute of Technology - * All rights reserved - * - * This is a part of the Julius software. - */ +/** + * + * cJulius: JuliusLib wrapper class for C++ + * + * Copyright (c) 2009 Julius project team, Nagoya Institute of Technology + * All rights reserved + * + * This is a part of the Julius software. + */ #ifndef _JULIUSCLASS_H_ #define _JULIUSCLASS_H_ @@ -60,6 +60,9 @@ void setLogFile( const char *filename ); + void setModelLocale( const char *locale ); + _locale_t getModelLocale( void ); + bool initialize( int argnum, char *argarray[] ); bool initialize( char *jconffile ); bool loadJconf( char *jconffile );