From b9024197abb490ea2cada4046446023c2179542e Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 30 Jan 2018 15:00:32 -0600 Subject: app_confbridge: Update dsp_silence_threshold and dsp_talking_threshold docs. The dsp_talking_threshold does not represent time in milliseconds. It represents the average magnitude per sample in the audio packets. This is what the DSP uses to determine if a packet is silence or talking/noise. Change-Id: If6f939c100eb92a5ac6c21236559018eeaf58443 --- include/asterisk/bridge_technology.h | 6 ++---- include/asterisk/dsp.h | 38 ++++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/asterisk/bridge_technology.h b/include/asterisk/bridge_technology.h index eaea28de5..12fd49917 100644 --- a/include/asterisk/bridge_technology.h +++ b/include/asterisk/bridge_technology.h @@ -46,11 +46,9 @@ enum ast_bridge_preference { * performing talking optimizations. */ struct ast_bridge_tech_optimizations { - /*! The amount of time in ms that talking must be detected before - * the dsp determines that talking has occurred */ + /*! Minimum average magnitude threshold to determine talking by the DSP. */ unsigned int talking_threshold; - /*! The amount of time in ms that silence must be detected before - * the dsp determines that talking has stopped */ + /*! Time in ms of silence necessary to declare talking stopped by the bridge. */ unsigned int silence_threshold; /*! Whether or not the bridging technology should drop audio * detected as silence from the mix. */ diff --git a/include/asterisk/dsp.h b/include/asterisk/dsp.h index 7e84ebe9c..d092e6b4c 100644 --- a/include/asterisk/dsp.h +++ b/include/asterisk/dsp.h @@ -87,7 +87,7 @@ void ast_dsp_free(struct ast_dsp *dsp); * created with */ unsigned int ast_dsp_get_sample_rate(const struct ast_dsp *dsp); -/*! \brief Set threshold value for silence */ +/*! \brief Set the minimum average magnitude threshold to determine talking by the DSP. */ void ast_dsp_set_threshold(struct ast_dsp *dsp, int threshold); /*! \brief Set number of required cadences for busy */ @@ -106,19 +106,41 @@ int ast_dsp_set_call_progress_zone(struct ast_dsp *dsp, char *zone); busies, and call progress, all dependent upon which features are enabled */ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, struct ast_frame *inf); -/*! \brief Return non-zero if this is silence. Updates "totalsilence" with the total - number of seconds of silence */ +/*! + * \brief Process the audio frame for silence. + * + * \param dsp DSP processing audio media. + * \param f Audio frame to process. + * \param totalsilence Variable to set to the total accumulated silence in ms + * seen by the DSP since the last noise. + * + * \return Non-zero if the frame is silence. + */ int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence); -/*! \brief Return non-zero if this is silence. Updates "totalsilence" with the total - number of seconds of silence. Returns the average energy of the samples in the frame - in frames_energy variable. */ +/*! + * \brief Process the audio frame for silence. + * + * \param dsp DSP processing audio media. + * \param f Audio frame to process. + * \param totalsilence Variable to set to the total accumulated silence in ms + * seen by the DSP since the last noise. + * \param frames_energy Variable to set to the average energy of the samples in the frame. + * + * \return Non-zero if the frame is silence. + */ int ast_dsp_silence_with_energy(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence, int *frames_energy); /*! - * \brief Return non-zero if this is noise. Updates "totalnoise" with the total - * number of seconds of noise + * \brief Process the audio frame for noise. * \since 1.6.1 + * + * \param dsp DSP processing audio media. + * \param f Audio frame to process. + * \param totalnoise Variable to set to the total accumulated noise in ms + * seen by the DSP since the last silence. + * + * \return Non-zero if the frame is silence. */ int ast_dsp_noise(struct ast_dsp *dsp, struct ast_frame *f, int *totalnoise); -- cgit v1.2.3