| 1 | /* GStreamer |
| 2 | * Copyright (C) 2009 Tiago Katcipis <[email protected]> |
| 3 | * Copyright (C) 2009 Paulo Pizarro <[email protected]> |
| 4 | * Copyright (C) 2009 Rogério Santos <[email protected]> |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public |
| 17 | * License along with this library; if not, write to the |
| 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 19 | * Boston, MA 02110-1301, USA. |
| 20 | */ |
| 21 | |
| 22 | |
| 23 | #ifndef __VAD_FILTER_H__ |
| 24 | #define __VAD_FILTER_H__ |
| 25 | |
| 26 | #define VAD_SILENCE 0 |
| 27 | #define VAD_VOICE 1 |
| 28 | |
| 29 | |
| 30 | typedef struct _vad_s VADFilter; |
| 31 | |
| 32 | gint vad_update(VADFilter *p, gint16 *data, gint len); |
| 33 | |
| 34 | void vad_set_hysteresis(VADFilter *p, guint64 hysteresis); |
| 35 | |
| 36 | guint64 vad_get_hysteresis(VADFilter *p); |
| 37 | |
| 38 | void vad_set_threshold(VADFilter *p, gint threshold_db); |
| 39 | |
| 40 | gint vad_get_threshold_as_db(VADFilter *p); |
| 41 | |
| 42 | VADFilter* vad_new(guint64 hysteresis, gint threshold); |
| 43 | |
| 44 | void vad_reset(VADFilter *p); |
| 45 | |
| 46 | void vad_destroy(VADFilter *p); |
| 47 | |
| 48 | #endif /* __VAD_FILTER__ */ |