Skip to content

Fixed handling of bargein and dtmfBargein parameters.#1388

Open
dmitrikozlov wants to merge 2 commits intojambonz:mainfrom
dmitrikozlov:bargein
Open

Fixed handling of bargein and dtmfBargein parameters.#1388
dmitrikozlov wants to merge 2 commits intojambonz:mainfrom
dmitrikozlov:bargein

Conversation

@dmitrikozlov
Copy link
Copy Markdown

This change fixes the following test cases

let say = {
      text: text,
      synthesizer: googleSpeech,
    };
let recognizer = {
        vendor: 'google',
        language: 'en-US',
      };
let promptParams = {
      actionHook: '/loop',
      input: ['digits', 'speech'],
      timeout: 10,
      say: say,
      recogniser: recognizer,
}

Case 1

let promptParams = {
      dtmfBargein: false,
      maxDigits:1,
    };

Expected: Bargein with DTMF doesn’t happen
Result Bargein with either DTMF or speech still happens

Case 2

let promptParams = {
      bargein: false,
      dtmfBargein: false,
      maxDigits:1,
    };

Expected: Bargein with DTMF or Speech doesn’t happen
Result Barge-in with either DTMF or speech still happens

Case 3

let promptParams = {
      listenDuringPrompt: true,
      bargein: true,
      dtmfBargein: true,
      maxDigits:1,
    };

Expected: User can bargein prompts with DTMF or speech. Bardein happens almost immediately after a DTMF or speech input.

Result: Bargein with DTMF works as expected; Bargein with speech behaves badly. Sometimes bargein happens on no speech input—background noise? Sometimes prompts are interrupted either on the first spoken word or on the second or even third. The user app may receive all of the spoken words or only the first spoken word when interrupted after the second spoken word.

Case 4

let promptParams = {
      listenDuringPrompt: true,
      bargein: false,
      dtmfBargein: false,
      maxDigits:1,
    };

Expected: prompt plays to the end
Result: prompt interrupted with either speech or DTMF.

  - Fix dtmfBargein: only interrupt prompt when dtmfBargein=true
  - Fix bargein: only interrupt prompt when bargein=true
  - Collect input during prompt and resolve after completion when bargein=false
  - Only kill audio in _resolve if prompt is still playing
  - Handle edge case when no prompt exists
@davehorton
Copy link
Copy Markdown
Contributor

@xquanluu need your review here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants