summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-25 21:15:49 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-25 21:15:49 +0000
commit478d2bc6e45a2dc66472bb577a77537ea97fac5d (patch)
tree118a6e71af8bdd3b1b26914ed8814945e20a6d14 /pjmedia/include
parente5290641d50566a9aff8eae9bec8d585f79077de (diff)
Fixed echo in conference, and add ability to shrink buffer in jitter buffer
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@229 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/silencedet.h38
1 files changed, 27 insertions, 11 deletions
diff --git a/pjmedia/include/pjmedia/silencedet.h b/pjmedia/include/pjmedia/silencedet.h
index 91da8597..f251c082 100644
--- a/pjmedia/include/pjmedia/silencedet.h
+++ b/pjmedia/include/pjmedia/silencedet.h
@@ -85,6 +85,25 @@ PJ_DECL(pj_status_t) pjmedia_silence_det_disable( pjmedia_silence_det *sd );
/**
+ * Perform voice activity detection on the given input samples. This
+ * function uses #pjmedia_calc_avg_signal() and #pjmedia_silence_det_apply()
+ * for its calculation.
+ *
+ * @param sd The silence detector instance.
+ * @param samples Pointer to 16-bit PCM input samples.
+ * @param count Number of samples in the input.
+ * @param p_level Optional pointer to receive average signal level
+ * of the input samples.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_bool_t) pjmedia_silence_det_detect( pjmedia_silence_det *sd,
+ const pj_int16_t samples[],
+ pj_size_t count,
+ pj_int32_t *p_level);
+
+
+/**
* Calculate average signal level for the given samples.
*
* @param samples Pointer to 16-bit PCM samples.
@@ -93,25 +112,22 @@ PJ_DECL(pj_status_t) pjmedia_silence_det_disable( pjmedia_silence_det *sd );
* @return The average signal level, which simply is total level
* divided by number of samples.
*/
-PJ_DECL(pj_int32_t) pjmedia_silence_det_calc_avg_signal( const pj_int16_t samples[],
- pj_size_t count );
+PJ_DECL(pj_int32_t) pjmedia_calc_avg_signal( const pj_int16_t samples[],
+ pj_size_t count );
+
/**
- * Perform voice activity detection on the given input samples.
+ * Perform voice activity detection, given the specified average signal
+ * level.
*
* @param sd The silence detector instance.
- * @param samples Pointer to 16-bit PCM input samples.
- * @param count Number of samples in the input.
- * @param p_level Optional pointer to receive average signal level
- * of the input samples.
+ * @param level Signal level.
*
* @return PJ_SUCCESS on success.
*/
-PJ_DECL(pj_bool_t) pjmedia_silence_det_detect_silence( pjmedia_silence_det *sd,
- const pj_int16_t samples[],
- pj_size_t count,
- pj_int32_t *p_level);
+PJ_DECL(pj_bool_t) pjmedia_silence_det_apply( pjmedia_silence_det *sd,
+ pj_uint32_t level);
PJ_END_DECL