[asterisk-bugs] [JIRA] (ASTERISK-27816) func_talkdetect's logic is completely broken

Moritz Fain (JIRA) noreply at issues.asterisk.org
Fri Apr 20 03:14:50 CDT 2018


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243116#comment-243116 ] 

Moritz Fain commented on ASTERISK-27816:
----------------------------------------

I disagree with "only a documentation problem".

I would say func_talkdetect is broken by design: it *always* triggers a talking started event, regardless of DSP silence or noise/talking because it doesn't use DSP's information whether there has been noise/talking at all. Right from the start {{total_silence}} is 0 and {{td_params->talking}} is also 0 which makes {{update_taking}} to be set to 1 which in turn triggers the event.

{code}
	if (total_silence < td_params->dsp_silence_threshold) {
		if (!td_params->talking) {
			update_talking = 1;
			td_params->talking_start = ast_tvnow();
		}
		td_params->talking = 1;
	} else {
            ...
	}
{code}

I think the idea to have both, a talking threshold and a silence threshold *in milliseconds* (as the documentation states and what maybe was the author's initial intention) is quite useful because otherwise TALK_DETECT would always detect a short crackling or a cough as "talking". Of course you can play around with the DSP threshold but then real talking might not be detected. So I would rather change the code to what the documentation says (plus fix the documention).

That way you could say "talking" is DSP detected noise with a length of at least talking_threshold milliseconds and we fell "silent" as soon as silent_threshold milliseconds have passed without the DSP detected noise.

>From the argument description of the current documentation:
{code}
dsp_silence_threshold - The time in milliseconds before which a user is considered silent.
dsp_talking_threshold - The time in milliseconds after which a user is considered talking.
{code}

> func_talkdetect's logic is completely broken
> --------------------------------------------
>
>                 Key: ASTERISK-27816
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27816
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_talkdetect
>    Affects Versions: 15.3.0
>            Reporter: Moritz Fain
>
> Logic in func_talkdetect.c is completely wrong regarding the thresholds. It is mixing millisecond thresholds (the one's that are passed to TALK_DETECT via set) with the DSP's avg. amplitude thresholds.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list