Commands don't work of languages with non-english characters
See original GitHub issueSo the speech recognition does support for instance, hebrew, however when trying to write a command in hebrew, the callback isn’t summoned. according to the transcript, it was spoken perfectly, but it did not activate the command callback that was set up. Also, resetTranscript does not work when called by handleReset (or perhaphs it’s just not called), only with the spoken ‘clear’ command
const { resetTranscript } = useSpeechRecognition()
const commands = [
{
command: 'clear',
callback: ({ resetTranscript }) => resetTranscript()
},
{
command: ['Everything is working','Nothing is working','Just the audio works','Just the video works','שלום'],
callback: (command, spokenPhrase ) => {
sendAns(spokenPhrase)
handleReset();
},
isFuzzyMatch: true,
fuzzyMatchingThreshold: 0.2},
]
const { transcript } = useSpeechRecognition({ commands })
const handleReset = useCallback(() => {
SpeechRecognition.stopListening()
SpeechRecognition.startListening({
continuous:true,
language: 'he'
})
},[]);
if (!SpeechRecognition.browserSupportsSpeechRecognition()) {
return null
}else{
SpeechRecognition.startListening({
continuous:true,
language: 'he'
});
}
for reference, the sendAns command sends the spoken phrase back to the parent
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Can't type non-english characters in terminal
I use gnome desktop with Debian and wayland on my laptop, so I use command-line tools and 'gnome-settings' program. You might need the...
Read more >CMD: How to use non-English characters? - Super User
Start CMD with CMD /u to cause CMD to redirect to files in UTF-16, Little Endian. Windows distinguishes between showed up text and...
Read more >How to print a variable having non-English characters to the ...
Open the "Command Prompt" properties and make sure to select one of the new fonts that should appear to support your language.
Read more >Non-English-based programming languages - Wikipedia
Non -English-based programming languages are programming languages that do not use keywords taken from or inspired by English vocabulary.
Read more >Sending Special Character for non-English languages
Hello Everyone :D , I am trying to send strings in a field using AHK script. The string has some characters that is...
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 Free
Top 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
I found a solution that appears to work! I connected my webcam stream to hark and had it set a redux boolean on the speaking and stopped_speaking events. then I added this useEffect:
isRecog is a selector from redux signaling a request to record. All I need now is to make sure it doesn’t interfere with the media recorder I have set up, but I think this is a great solution for anyone looking to activate speech recognition when the user speaks.
I’ll probably change my code then, to manually start the listen on a function call. but I will also need to recognize when listening has stopped.