BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Error thrown and uncaught while speaking " " (empty space) on Safari using Cognitive Services

Open compulim opened this issue 4 years ago • 2 comments

(Reported internally via Teams on behalf of customer)

Screenshots

image

Version

Possibly 4.12.0

Describe the bug

When using Cognitive Services to speak on an activity with speak field of an empty space " ", AudioContext.decodeAudioData will throw an exception, because the TTS-ed wavedata is empty (0 bytes in length, instead of MP3).

Thus, AudioContext.decodeAudioData(ArrayBuffer.from([])) would throw an exception.

This only happens in Safari because Safari is using an older signature of AudioContext.decodeAudioData, a.k.a. callback signature.

image

Due to a bug on how we handle the callback signature, we throw an exception of null. It propagate up through here:

image

Since error is null, accessing error.stack will trigger an exception, which is uncaught.

Steps to reproduce

  1. On Safari, speak to a bot that will result in an activity with speak field set to " " (empty space)

Expected behavior

It should not narrate anything.

Additional context

[Bug]

compulim avatar Mar 04 '21 22:03 compulim

For customers experiencing this problem: Temporary work around: do not send a speak field with a single space

corinagum avatar Mar 04 '21 22:03 corinagum

The is also related to #3782.

compulim avatar May 06 '21 22:05 compulim