RTS API Documentation  1.10.11
switch_vad.h
Go to the documentation of this file.
1 /*
2  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
3  * Copyright (C) 2018, Anthony Minessale II <anthm@freeswitch.org>
4  *
5  * Version: MPL 1.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
18  *
19  * The Initial Developer of the Original Code is
20  * Anthony Minessale II <anthm@freeswitch.org>
21  * Portions created by the Initial Developer are Copyright (C)
22  * the Initial Developer. All Rights Reserved.
23  *
24  * Contributor(s):
25  *
26  * Seven Du <dujinfang@gmail.com>
27  *
28  *
29  * switch_vad.h VAD code with optional libfvad
30  *
31  */
32 /*!
33  \defgroup vad1 VAD code with optional libfvad
34  \ingroup core1
35  \{
36 */
37 #ifndef FREESWITCH_VAD_H
38 #define FREESWITCH_VAD_H
39 
41 
42 SWITCH_DECLARE(switch_vad_t *) switch_vad_init(int sample_rate, int channels);
43 
44 /*
45  * Valid modes are -1 ("disable fvad, using native"), 0 ("quality"), 1 ("low bitrate"), 2 ("aggressive"), and 3 * ("very aggressive").
46  * The default mode is -1.
47 */
48 
50 SWITCH_DECLARE(void) switch_vad_set_param(switch_vad_t *vad, const char *key, int val);
51 SWITCH_DECLARE(switch_vad_state_t) switch_vad_process(switch_vad_t *vad, int16_t *data, unsigned int samples);
55 
57 
59 #endif
60 /* For Emacs:
61  * Local Variables:
62  * mode:c
63  * indent-tabs-mode:t
64  * tab-width:4
65  * c-basic-offset:4
66  * End:
67  * For VIM:
68  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
69  */
switch_vad_state_t switch_vad_get_state(switch_vad_t *vad)
Definition: switch_vad.c:248
void switch_vad_reset(switch_vad_t *vad)
Definition: switch_vad.c:167
#define SWITCH_END_EXTERN_C
Definition: switch.h:43
void switch_vad_destroy(switch_vad_t **vad)
Definition: switch_vad.c:254
switch_vad_state_t
Definition: switch_types.h:663
switch_byte_t switch_byte_t uint32_t switch_bitpack_mode_t mode
SWITCH_BEGIN_EXTERN_C switch_vad_t * switch_vad_init(int sample_rate, int channels)
Definition: switch_vad.c:75
switch_vad_state_t switch_vad_process(switch_vad_t *vad, int16_t *data, unsigned int samples)
Definition: switch_vad.c:181
void switch_vad_set_param(switch_vad_t *vad, const char *key, int val)
Definition: switch_vad.c:132
#define SWITCH_DECLARE(type)
const char * switch_vad_state2str(switch_vad_state_t state)
Definition: switch_vad.c:59
char * key
Definition: switch_msrp.c:64
int switch_vad_set_mode(switch_vad_t *vad, int mode)
Definition: switch_vad.c:96
#define SWITCH_BEGIN_EXTERN_C
Definition: switch.h:42