endptr.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 2004 Carnegie Mellon University. All rights
4  * reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
19  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
22  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * ====================================================================
31  *
32  */
33 /*************************************************
34  * CMU CALO Speech Project
35  *
36  * Copyright (c) 2004 Carnegie Mellon University.
37  * ALL RIGHTS RESERVED.
38  * **********************************************
39  *
40  * 11-Jul-2004 Ziad Al Bawab (ziada@cs.cmu.edu) at Carnegie Mellon University
41  * Created
42  * HISTORY
43  * $Log$
44  * Revision 1.1 2006/04/05 20:27:30 dhdfu
45  * A Great Reorganzation of header files and executables
46  *
47  * Revision 1.7 2006/02/23 04:05:21 arthchan2003
48  * Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: fixed dox-doc.
49  *
50  *
51  * Revision 1.5.4.1 2005/07/05 06:46:23 arthchan2003
52  * 1, Merged from HEAD. 2, fixed dox-doc.
53  *
54  * Revision 1.6 2005/07/02 04:24:45 egouvea
55  * Changed some hardwired constants to user defined parameters in the end pointer. Tested with make test-ep.
56  *
57  * Revision 1.5 2005/06/21 21:12:05 arthchan2003
58  * Added some bogus comments to endptr.h
59  *
60  * Revision 1.4 2005/06/21 21:07:28 arthchan2003
61  * Added keyword.
62  *
63  * Revision 1.2 2005/06/15 06:48:54 archan
64  * Sphinx3 to s3.generic: 1, updated the endptr and classify 's code, 2, also added
65  *
66  */
67 
68 #include "fe.h"
69 #include "classify.h"
70 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 #if 0
78 } /* Fool Emacs into not indenting things. */
79 #endif
80 
81 #ifndef __END_POINTER__
82 #define __END_POINTER__
83 
89 typedef struct{
90  int status;
91  int leader;
92  int spbegin;
93  int spend;
94  int trailer;
100  int UTT_F_END;
103 } endpointer_t;
104 
105 
108 #define STAT_OTHER 0
109 #define STAT_BEGIN 1
110 #define STAT_SPEECH 2
111 #define STAT_END 3
112 #define STAT_CANCEL 4
114 /* End-Pointing parameters */
115 
116 #define PAD_T_BEFORE "0.15"
117 #define PAD_T_AFTER "0.2"
118 #define UTT_T_START "0.08"
119 #define UTT_T_END "0.30"
120 #define UTT_T_CANCEL "0.05"
122 /*#define PAD_T_AFTER 0.15 // to pad this much of seconds after spend
123  #define UTT_T_END 0.20 // to end an utterance after this much of non-speech seconds
124  #define UTT_T_CANCEL 0.08 // to cancel an utterance after this much of non-speech seconds */
125 
126 
129  float pad_t_before,
130  float pad_t_after,
131  float utt_t_start,
132  float utt_t_end,
133  float utt_t_cancel
134  );
135 
137 void endpointer_free(endpointer_t *ENDPTR
138  );
139 
140 void endpointer_update_stat (endpointer_t *ENDPTR,
141  fe_t *FE,
142  class_t *CLASSW,
143  int _class
144  );
145 
147 float endptr_frame2secs_beg (fe_t *FE,
148  int frame
149  );
150 
152 float endptr_frame2secs_end (fe_t *FE,
153  int frame
154  );
155 
156 #endif /*__END_POINTER__*/
157 
158 #if 0
159 { /* Stop indent from complaining */
160 #endif
161 #ifdef __cplusplus
162 }
163 #endif
164