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

speech options loading multiple times

Open premaarya opened this issue 9 years ago • 2 comments

I am have a requirement: to have the response to be displayed as text(not spoken out). this should be controlled by a check box "Audio Response". I am using the speech feature. I have a check box click handler in which just recreate the BotChat.App{} ... with getSpeechOption... passing the value of speechSynthesizer with null or proper value.

  BotChat.App({
                botConnection: botConnection,
                user: user,
                bot: bot,
                locale: params['locale'],
                resize: 'detect',
                sendTyping: true,   
                **speechOptions: getSpeechOptions(),**
            }, document.getElementById("BotChatGoesHere"));

As BotChat.App is called multiple times as user check and uncheck the AudioResponse .. The response is spoken as many times as the AudioResponse is checked (speechSynthesizer!= null) .

Seems the speechSynthesizer is not disposed when the BotChat app is loaded again... Any quick solution?

premaarya avatar Jul 21 '17 22:07 premaarya

Hi @premaarya, BotChat.App is meant to be called only once per instantiation of the page. Your scenario is unique in that we haven't anticipated your use case. I don't suppose that we will have a quick solution.

@shahidkhuram - do you have any insight on this?

danmarshall avatar Jul 21 '17 22:07 danmarshall

I am using the BotChat.App in an Iframe so just reloading the page with a query parameter for speechSynthesizer .. it is working .. however loosing the chat history ..which is also ok. Will keep an eye on this thread for better solution.

premaarya avatar Jul 22 '17 01:07 premaarya