PocketSphinx  5prealpha
kws_detections.h
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 2014 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  *
19  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
20  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
23  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  * ====================================================================
32  *
33  */
34 
35 /*
36  * kws_detections.h -- Structures for storing keyphrase spotting results.
37  */
38 
39 #ifndef __KWS_DETECTIONS_H__
40 #define __KWS_DETECTIONS_H__
41 
42 /* SphinxBase headers. */
43 #include <sphinxbase/glist.h>
44 
45 /* Local headers. */
46 #include "pocketsphinx_internal.h"
47 #include "hmm.h"
48 
49 typedef struct kws_detection_s {
50  const char* keyphrase;
51  frame_idx_t sf;
52  frame_idx_t ef;
53  int32 prob;
54  int32 ascr;
56 
57 typedef struct kws_detections_s {
58  glist_t detect_list;
60 
64 void kws_detections_reset(kws_detections_t *detections);
65 
69 void kws_detections_add(kws_detections_t *detections, const char* keyphrase, int sf, int ef, int prob, int ascr);
70 
74 char* kws_detections_hyp_str(kws_detections_t *detections, int frame, int delay);
75 
76 #endif /* __KWS_DETECTIONS_H__ */
Internal implementation of PocketSphinx decoder.
Implementation of HMM base structure.
int32 frame_idx_t
Type for frame index values.
Definition: hmm.h:64