00001 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */ 00002 /* ==================================================================== 00003 * Copyright (c) 2004 Carnegie Mellon University. All rights 00004 * reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions 00008 * are met: 00009 * 00010 * 1. Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in 00015 * the documentation and/or other materials provided with the 00016 * distribution. 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 00019 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00020 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00021 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY 00022 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00023 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00024 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00025 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00026 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00028 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00029 * 00030 * ==================================================================== 00031 * 00032 */ 00033 /************************************************* 00034 * CMU CALO Speech Project 00035 * 00036 * Copyright (c) 2004 Carnegie Mellon University. 00037 * ALL RIGHTS RESERVED. 00038 * ********************************************** 00039 * 00040 * 11-Jul-2004 Ziad Al Bawab (ziada@cs.cmu.edu) at Carnegie Mellon University 00041 * Created 00042 * HISTORY 00043 * $Log$ 00044 * Revision 1.1 2006/04/05 20:27:30 dhdfu 00045 * A Great Reorganzation of header files and executables 00046 * 00047 * Revision 1.7 2006/02/23 04:05:21 arthchan2003 00048 * Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: fixed dox-doc. 00049 * 00050 * 00051 * Revision 1.5.4.1 2005/07/05 06:46:23 arthchan2003 00052 * 1, Merged from HEAD. 2, fixed dox-doc. 00053 * 00054 * Revision 1.6 2005/07/02 04:24:45 egouvea 00055 * Changed some hardwired constants to user defined parameters in the end pointer. Tested with make test-ep. 00056 * 00057 * Revision 1.5 2005/06/21 21:12:05 arthchan2003 00058 * Added some bogus comments to endptr.h 00059 * 00060 * Revision 1.4 2005/06/21 21:07:28 arthchan2003 00061 * Added keyword. 00062 * 00063 * Revision 1.2 2005/06/15 06:48:54 archan 00064 * Sphinx3 to s3.generic: 1, updated the endptr and classify 's code, 2, also added 00065 * 00066 */ 00067 00068 #include "fe.h" 00069 #include "classify.h" 00070 00074 #ifdef __cplusplus 00075 extern "C" { 00076 #endif 00077 #if 0 00078 } /* Fool Emacs into not indenting things. */ 00079 #endif 00080 00081 #ifndef __END_POINTER__ 00082 #define __END_POINTER__ 00083 00089 typedef struct{ 00090 int status; 00091 int leader; 00092 int spbegin; 00093 int spend; 00094 int trailer; 00095 int utt_counter; 00097 int PAD_F_BEFORE; 00098 int PAD_F_AFTER; 00099 int UTT_F_START; 00100 int UTT_F_END; 00101 int UTT_F_CANCEL; 00103 } endpointer_t; 00104 00105 00108 #define STAT_OTHER 0 00109 #define STAT_BEGIN 1 00110 #define STAT_SPEECH 2 00111 #define STAT_END 3 00112 #define STAT_CANCEL 4 00114 /* End-Pointing parameters */ 00115 00116 #define PAD_T_BEFORE "0.15" 00117 #define PAD_T_AFTER "0.2" 00118 #define UTT_T_START "0.08" 00119 #define UTT_T_END "0.30" 00120 #define UTT_T_CANCEL "0.05" 00122 /*#define PAD_T_AFTER 0.15 // to pad this much of seconds after spend 00123 #define UTT_T_END 0.20 // to end an utterance after this much of non-speech seconds 00124 #define UTT_T_CANCEL 0.08 // to cancel an utterance after this much of non-speech seconds */ 00125 00126 00128 endpointer_t * endpointer_initialize(fe_t *FE, 00129 float pad_t_before, 00130 float pad_t_after, 00131 float utt_t_start, 00132 float utt_t_end, 00133 float utt_t_cancel 00134 ); 00135 00137 void endpointer_free(endpointer_t *ENDPTR 00138 ); 00139 00140 void endpointer_update_stat (endpointer_t *ENDPTR, 00141 fe_t *FE, 00142 class_t *CLASSW, 00143 int _class 00144 ); 00145 00147 float endptr_frame2secs_beg (fe_t *FE, 00148 int frame 00149 ); 00150 00152 float endptr_frame2secs_end (fe_t *FE, 00153 int frame 00154 ); 00155 00156 #endif /*__END_POINTER__*/ 00157 00158 #if 0 00159 { /* Stop indent from complaining */ 00160 #endif 00161 #ifdef __cplusplus 00162 } 00163 #endif 00164