SpeechKITT
SpeechKITT copied to clipboard
SpeechKITT.displayRecognizedSentence (true) not working, Any alternative?
@TalAter Sir I really big fan of you because of your all open-source cool projects......
I am Using your Annyang js on my project which working very well but I don't know why
SpeechKITT.displayRecognizedSentence (true) not working, But I badly need to show what the user speaks on the mic, is there any fix for this, if not then is there any alternative way that I can perform to do this?
here is the code
`if (annyang) { // Add our commands to annyang annyang.addCommands({ 'hello': function() { alert('Hello world!'); } });
// Tell KITT to use annyang
SpeechKITT.annyang();
// Define a stylesheet for KITT to use
SpeechKITT.setStylesheet('//cdnjs.cloudflare.com/ajax/libs/SpeechKITT/0.3.0/themes/flat.css');
// Render KITT's interface
SpeechKITT.vroom();
SpeechKITT.displayRecognizedSentence(true);
}`
Hi @alexia-rose
Thanks for bringing this to my attention. I just tested this and I can see the issue you are describing.
It looks like KITT is correctly adding the recognized sentence text and appending it to the DOM...
https://user-images.githubusercontent.com/926653/140663541-ebfc6e54-5bd1-4c52-b9d7-4abfd61d7cb2.mp4
... unfortunately it looks like the element containing that text has display: none; set on it.
I will try to find some time to fix this, but it won't likely be in the next few months.
If you would like to tackle this and send a PR with a fix, that would be awesome. Alternatively, you might be able to get around this bug for now with a custom stylesheet that replaces themes/flat.css. Specifically the section shown here https://github.com/TalAter/SpeechKITT/commit/b2306c4445b17cea2038412e9b181c571b2496e9
@TalAter thank you so much for your response and time sir,
I am pretty new to web development so having problems understanding how I can fix it by myself :(
I will wait for you to fix this 😢 until I will use it without this feature
or does Annyang provide any method that returns recognized words?