Disable Text-To-Speech issue
See original GitHub issueEdited by @compulim to add what we should fix.
Description
My customer would like to enable the Speech-To-Text feature, but not the Text-To-Speech one. I tried to set to null the properties speechSynthesis and SpeechSynthesisUtterance but it’s not working. This is my code:
var _botConnection = new window.WebChat.createDirectLine({
token: '{secret}'
});
const subscriptionKey = 'xxxxxxxxxxxxxx';
async function createPonyfillFactory() {
const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
region: 'westeurope',
speechRecognitionEndpointId: 'yyyyyyyyyyyyy',
subscriptionKey
});
return options => {
const webSpeechPonyfill = webSpeechPonyfillFactory(options);
return {
SpeechGrammarList: webSpeechPonyfill.SpeechGrammarList,
SpeechRecognition: webSpeechPonyfill.SpeechRecognition,
speechSynthesis: null,
SpeechSynthesisUtterance: null
}
};
};
window.WebChat.renderWebChat({
directLine: _botConnection,
webSpeechPonyfillFactory: await createPonyfillFactory()
},
document.getElementById('webchat')
);
This is the console output:
_webchat.js:1 TypeError: i is not a constructor
at c (webchat.js:1)
at webchat.js:1
at c (webchat.js:1)
at Generator._invoke (webchat.js:1)
at Generator.e.<computed> [as next] (webchat.js:1)
at n (webchat.js:1)
at s (webchat.js:1)
at webchat.js:1
at new Promise (<anonymous>)
at webchat.js:1_
The first interaction works fine, but after it the microphone icon is greyed out and you cannot dictate anymore.
Could you please help me? Thanks
What we should fix
(Will update this from time to time)
Current error:
createContext.js:25 TypeError: SpeechSynthesisUtterance is not a constructor
at createNativeUtterance (QueuedUtterance.js:14)
at _callee4$ (QueuedUtterance.js:58)
at tryCatch (runtime.js:45)
at Generator.invoke [as _invoke] (runtime.js:271)
at Generator.prototype.<computed> [as next] (runtime.js:97)
at asyncGeneratorStep (asyncToGenerator.js:3)
at _next (asyncToGenerator.js:25)
at eval (asyncToGenerator.js:32)
at new Promise (<anonymous>)
at eval (asyncToGenerator.js:21)
We need to prevent synthesizing if it is null
/falsy. So something up this call stack need to be blocked.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
TextToSpeech stop() not working - Stack Overflow
It is a common problem. @Override protected void onStop() { super.onStop(); if(tts != null){ tts.shutdown(); } }.
Read more >How to Turn Off Google Text to Speech? - Folio3AI Blog
How to disable google text to speech on Windows? · Open the Settings · Click on “Interaction” on the right pane · Click...
Read more >How to Disable or Enable Text to Speech - Republic Wireless
Objective. How to Disable or Enable Text to Speech. Environment. Moto X2; Moto G3; Android 5.1.1 Lollipop. Procedure. Tap Apps; Tap Settings; Tap...
Read more >How to disable Text To Speech on Raspberry Pi?
Check to see if you have the Orca Screen reader installed (package name: orca). I think it gets installed automatically when a certain...
Read more >Correcting a Samsung Device Text-to Speech Problem
Finally, change the preferred text-to speech engine to Google Text-to Speech. This should correct the system error and allow you to run ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got a fix in PR. 😄
/👀
(Looking at this now.)