Changeset 457 for pjproject/trunk/pjmedia/include/pjmedia/silencedet.h
- Timestamp:
- May 19, 2006 3:58:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/silencedet.h
r355 r457 37 37 38 38 /** 39 * Suggested or default threshold to be set for fixed silence detection 40 * or as starting threshold for adaptive silence detection. The threshold 41 * has the range from zero to 255. 42 */ 43 #define PJMEDIA_SILENCE_DET_THRESHOLD 4 44 45 46 /** 39 47 * Create voice activity detector with default settings. The default settings 40 * are to perform adaptive silence detection, which adjusts the noise level 41 * dynamically based on current input level. 48 * are set to adaptive silence detection with the default threshold. 42 49 * 43 * @param pool Pool for allocating the structure. 44 * @param p_sd Pointer to receive the silence detector instance. 50 * @param pool Pool for allocating the structure. 51 * @param clock_rate Clock rate. 52 * @param samples_per_frame Number of samples per frame. The clock_rate and 53 * samples_per_frame is only used to calculate the 54 * frame time, from which some timing parameters 55 * are calculated from. 56 * @param p_sd Pointer to receive the silence detector instance. 45 57 * 46 * @return PJ_SUCCESS on success.58 * @return PJ_SUCCESS on success. 47 59 */ 48 60 PJ_DECL(pj_status_t) pjmedia_silence_det_create( pj_pool_t *pool, 61 unsigned clock_rate, 62 unsigned samples_per_frame, 49 63 pjmedia_silence_det **p_sd ); 50 64 51 65 52 66 /** 53 * Set the sd to operate in adaptive mode. 54 * 55 * @param sd The silence detector 56 * @param frame_size Number of samples per frame. 57 * 58 * @return PJ_SUCCESS on success. 59 */ 60 PJ_DECL(pj_status_t) pjmedia_silence_det_set_adaptive( pjmedia_silence_det *sd, 61 unsigned frame_size); 62 63 64 /** 65 * Set the sd to operate in fixed threshold mode. 67 * Set the sd to operate in fixed threshold mode. With fixed threshold mode, 68 * the threshold will not be changed adaptively. 66 69 * 67 70 * @param sd The silence detector 68 * @param frame_size Number of samplse per frame.69 * @param threshold The silencethreshold.71 * @param threshold The silence threshold, or -1 to use default 72 * threshold. 70 73 * 71 74 * @return PJ_SUCCESS on success. 72 75 */ 73 76 PJ_DECL(pj_status_t) pjmedia_silence_det_set_fixed( pjmedia_silence_det *sd, 74 unsigned frame_size, 75 unsigned threshold ); 77 int threshold ); 78 79 /** 80 * Set the sd to operate in adaptive mode. This is the default mode 81 * when the silence detector is created. 82 * 83 * @param sd The silence detector 84 * @param threshold Initial threshold to be set, or -1 to use default 85 * threshold. 86 * 87 * @return PJ_SUCCESS on success. 88 */ 89 PJ_DECL(pj_status_t) pjmedia_silence_det_set_adaptive(pjmedia_silence_det *sd, 90 int threshold); 91 92 /** 93 * Set other silence detector parameters. 94 * 95 * @param sd The silence detector 96 * @param min_silence Minimum duration of silence (in msec) before 97 * silence is reported. If -1 is specified, then 98 * the default value will be used. The default is 99 * 400 msec. 100 * @param min_signal Minimum duration of signal (in msec) before 101 * signal is reported. If -1 is specified, then 102 * the default value will be used. The default is 103 * one frame. 104 * @param recalc_time The interval to recalculate signal and silence 105 * proportion and to readjust the silence threshold 106 * when adaptive silence detection is set. If -1 107 * is specified, then the default value will be used. 108 * The default value is 5000 (msec). 109 * 110 * @return PJ_SUCCESS on success. 111 */ 112 PJ_DECL(pj_status_t) pjmedia_silence_det_set_params( pjmedia_silence_det *sd, 113 int min_silence, 114 int min_signal, 115 int recalc_time); 76 116 77 117 /**
Note: See TracChangeset
for help on using the changeset viewer.