How to use the botframework-webchat.Speech function in botframework-webchat

To help you get started, we’ve selected a few botframework-webchat examples, based on popular ways it is used in public projects.

github microsoft / BotFramework-Emulator / packages / app / client / src / ui / editor / emulator / parts / chat.tsx View on Github external
id: botId || 'bot',
      name: 'Bot'
    },
    botConnection: directLine,
    formatOptions: {
      showHeader: false
    },
    selectedActivity: selectedActivity$,
    showShell: mode === 'livechat',
    speechOptions:
      (endpoint && endpoint.appId && endpoint.appPassword) ? {
        speechRecognizer: new CognitiveServices.SpeechRecognizer({
          fetchCallback: getSpeechToken.bind(null, endpoint, false),
          fetchOnExpiryCallback: getSpeechToken.bind(null, endpoint, true)
        }),
        speechSynthesizer: new WebChat.Speech.BrowserSpeechSynthesizer()
      } : null,
    user: {
      id: userId || 'default-user',
      name: 'User'
    }
  };
}
github microsoft / BotFramework-Emulator / src / client / mainView.tsx View on Github external
adaptiveCardsHostConfig: AdaptiveCardsHostConfig,
                botConnection: this.directline,
                locale: activeBot.locale || remote.app.getLocale(),
                formatOptions: {
                    showHeader: false
                },
                selectedActivity: selectedActivity$() as any,
                user: this.getCurrentUser(settings.serverSettings),
                bot: { name: "Bot", id: activeBot.botId },
                resize: 'detect',
                speechOptions: {
                    speechRecognizer: new CognitiveServices.SpeechRecognizer({
                        fetchCallback: this.fetchSpeechToken.bind(this),
                        fetchOnExpiryCallback: this.fetchSpeechTokenOnExpiry.bind(this)
                    }),
                    speechSynthesizer: new BotChat.Speech.BrowserSpeechSynthesizer()
                }
            }
            InspectorActions.clear();
            return <div className="wc-app" ref={ref => this.initBotChatContainerRef(ref, initialWidth)}><BotChat.Chat key={this.reuseKey} {...props} /></div>
        } else {
            return (
                <div className='emu-chatview-background'>
                    <div className='box-centered' dangerouslySetInnerHTML={{ __html: Constants.botFrameworkIconEmbossed('', 158) }} />
                </div>
            );
        }
    }