Skip to content

Speech should accept authorizationToken in string format #2822

@compulim

Description

@compulim

Screenshots

image

Version

master

Describe the bug

When creating a ponyfill with authorizationToken and region as a string, it is throwing an error saying, "web-speech-cognitive-services: Authorization token must be a string."

This is because the createCognitiveServicesSpeechServicesPonyfillFactory.js is not resolving Promise.

The fix would be:

image

Steps to reproduce

  1. Use authorizationToken (string) and region (string) to create a Cognitive Services ponyfill factory (see the code below)
  2. Click on the microphone button
const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory( {
  authorizationToken,
  region
} );

Expected behavior

It should start speech recognition.

Additional context

Related to recent PR #2759.

Also, could we allow no reference grammar ID to be passed to the ponyfill?

Also, the error message is also not very visible until putting a breakpoint. Could we improve this?

[Bug]

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or an unintended behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions