UniMRCP
1.3.0
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
libs
mpf
include
mpf_activity_detector.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008-2014 Arsen Chaloyan
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
* $Id: mpf_activity_detector.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17
*/
18
19
#ifndef MPF_ACTIVITY_DETECTOR_H
20
#define MPF_ACTIVITY_DETECTOR_H
21
22
/**
23
* @file mpf_activity_detector.h
24
* @brief MPF Voice Activity Detector
25
*/
26
27
#include "
mpf_frame.h
"
28
#include "
mpf_codec_descriptor.h
"
29
30
APT_BEGIN_EXTERN_C
31
32
/** Opaque (voice) activity detector */
33
typedef
struct
mpf_activity_detector_t
mpf_activity_detector_t
;
34
35
/** Events of activity detector */
36
typedef
enum
{
37
MPF_DETECTOR_EVENT_NONE
,
/**< no event occurred */
38
MPF_DETECTOR_EVENT_ACTIVITY
,
/**< voice activity (transition to activity from inactivity state) */
39
MPF_DETECTOR_EVENT_INACTIVITY
,
/**< voice inactivity (transition to inactivity from activity state) */
40
MPF_DETECTOR_EVENT_NOINPUT
/**< noinput event occurred */
41
}
mpf_detector_event_e
;
42
43
44
/** Create activity detector */
45
MPF_DECLARE
(
mpf_activity_detector_t
*)
mpf_activity_detector_create
(apr_pool_t *pool);
46
47
/** Reset activity detector */
48
MPF_DECLARE
(
void
)
mpf_activity_detector_reset
(
mpf_activity_detector_t
*detector);
49
50
/** Set threshold of voice activity (silence) level */
51
MPF_DECLARE
(
void
)
mpf_activity_detector_level_set
(
mpf_activity_detector_t
*detector, apr_size_t level_threshold);
52
53
/** Set noinput timeout */
54
MPF_DECLARE
(
void
)
mpf_activity_detector_noinput_timeout_set
(
mpf_activity_detector_t
*detector, apr_size_t noinput_timeout);
55
56
/** Set timeout required to trigger speech (transition from inactive to active state) */
57
MPF_DECLARE
(
void
)
mpf_activity_detector_speech_timeout_set
(
mpf_activity_detector_t
*detector, apr_size_t speech_timeout);
58
59
/** Set timeout required to trigger silence (transition from active to inactive state) */
60
MPF_DECLARE
(
void
)
mpf_activity_detector_silence_timeout_set
(
mpf_activity_detector_t
*detector, apr_size_t silence_timeout);
61
62
/** Process current frame, return detected event if any */
63
MPF_DECLARE
(
mpf_detector_event_e
)
mpf_activity_detector_process
(
mpf_activity_detector_t
*detector, const
mpf_frame_t
*frame);
64
65
66
APT_END_EXTERN_C
67
68
#endif
/* MPF_ACTIVITY_DETECTOR_H */
Generated on Mon Feb 2 2015 19:41:38 for UniMRCP by
1.8.3.1