Changeset 228 for pjproject/trunk/pjmedia/include/pjmedia/silencedet.h
- Timestamp:
- Feb 25, 2006 2:04:42 AM (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/silencedet.h
r222 r228 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJMEDIA_ VAD_H__20 #define __PJMEDIA_ VAD_H__19 #ifndef __PJMEDIA_SILENCE_DET_H__ 20 #define __PJMEDIA_SILENCE_DET_H__ 21 21 22 22 23 23 /** 24 * @file vad.h25 * @brief Simple, adaptive silence detector.24 * @file silencedet.h 25 * @brief Adaptive silence detector. 26 26 */ 27 27 #include <pjmedia/types.h> … … 31 31 32 32 /** 33 * @see pjmedia_vad33 * Opaque declaration for silence detector. 34 34 */ 35 typedef struct pjmedia_ vad pjmedia_vad;35 typedef struct pjmedia_silence_det pjmedia_silence_det; 36 36 37 37 … … 42 42 * 43 43 * @param pool Pool for allocating the structure. 44 * @param p_ vad Pointer to receive the VADinstance.44 * @param p_sd Pointer to receive the silence detector instance. 45 45 * 46 46 * @return PJ_SUCCESS on success. 47 47 */ 48 PJ_DECL(pj_status_t) pjmedia_ vad_create( pj_pool_t *pool,49 pjmedia_vad **p_vad );48 PJ_DECL(pj_status_t) pjmedia_silence_det_create( pj_pool_t *pool, 49 pjmedia_silence_det **p_sd ); 50 50 51 51 52 52 /** 53 * Set the vad to operate in adaptive mode.53 * Set the sd to operate in adaptive mode. 54 54 * 55 * @param vad The vad56 * @param frame_size Number of samplseper frame.55 * @param sd The silence detector 56 * @param frame_size Number of samples per frame. 57 57 * 58 * @return 58 * @return PJ_SUCCESS on success. 59 59 */ 60 PJ_DECL(pj_status_t) pjmedia_ vad_set_adaptive( pjmedia_vad *vad,61 unsigned frame_size);60 PJ_DECL(pj_status_t) pjmedia_silence_det_set_adaptive( pjmedia_silence_det *sd, 61 unsigned frame_size); 62 62 63 63 64 64 /** 65 * Set the vad to operate in fixed threshold mode.65 * Set the sd to operate in fixed threshold mode. 66 66 * 67 * @param vad The vad67 * @param sd The silence detector 68 68 * @param frame_size Number of samplse per frame. 69 69 * @param threshold The silence threshold. … … 71 71 * @return PJ_SUCCESS on success. 72 72 */ 73 PJ_DECL(pj_status_t) pjmedia_ vad_set_fixed( pjmedia_vad *vad,74 unsigned frame_size,75 unsigned threshold );73 PJ_DECL(pj_status_t) pjmedia_silence_det_set_fixed( pjmedia_silence_det *sd, 74 unsigned frame_size, 75 unsigned threshold ); 76 76 77 77 /** 78 * Disable the vad.78 * Disable the silence detector. 79 79 * 80 * @param vad The vad80 * @param sd The silence detector 81 81 * 82 82 * @return PJ_SUCCESS on success. 83 83 */ 84 PJ_DECL(pj_status_t) pjmedia_ vad_disable( pjmedia_vad *vad );84 PJ_DECL(pj_status_t) pjmedia_silence_det_disable( pjmedia_silence_det *sd ); 85 85 86 86 … … 94 94 * divided by number of samples. 95 95 */ 96 PJ_DECL(pj_int32_t) pjmedia_ vad_calc_avg_signal( const pj_int16_t samples[],97 pj_size_t count );96 PJ_DECL(pj_int32_t) pjmedia_silence_det_calc_avg_signal( const pj_int16_t samples[], 97 pj_size_t count ); 98 98 99 99 … … 101 101 * Perform voice activity detection on the given input samples. 102 102 * 103 * @param vad The VADinstance.103 * @param sd The silence detector instance. 104 104 * @param samples Pointer to 16-bit PCM input samples. 105 105 * @param count Number of samples in the input. … … 109 109 * @return PJ_SUCCESS on success. 110 110 */ 111 PJ_DECL(pj_bool_t) pjmedia_ vad_detect_silence( pjmedia_vad *vad,112 const pj_int16_t samples[],113 pj_size_t count,114 pj_int32_t *p_level);111 PJ_DECL(pj_bool_t) pjmedia_silence_det_detect_silence( pjmedia_silence_det *sd, 112 const pj_int16_t samples[], 113 pj_size_t count, 114 pj_int32_t *p_level); 115 115 116 116 117 117 PJ_END_DECL 118 118 119 #endif /* __PJMEDIA_ VAD_H__ */119 #endif /* __PJMEDIA_SILENCE_DET_H__ */ 120 120
Note: See TracChangeset
for help on using the changeset viewer.