scalableminds / chatroom

React-based Chatroom Component for Rasa Stack
https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/demo.html
GNU Affero General Public License v3.0
307 stars 207 forks source link

Strange language behaviour #122

Closed dmedved90 closed 4 years ago

dmedved90 commented 4 years ago

Hi, When I change the language to Croatian with "hr-HR", I noticed strange behavior. In some cases, everything is working perfect but in some environments Chatroom "defaults" to English, TTS is on English. I all test cases I have the latest Chrome installed, identical Windows 10 installations with identical language settings on laptops. Everything is on the local network. Any idea where is the problem?

Thanks, Damir

hotzenklotz commented 4 years ago

@dmedved90 I am assuming you are only referring to TTS and STT here? (Not the chat text itself, right?)

To be honest, I haven't used those to features to much myself. Do you have any Chrome plugins that might get in the way? Other than that I am afraid I don't see any reason why Chrome should sometimes support Croatian and sometime not. :-/

Sorry that I can't be of more help here. Perhaps, you check out other web-API TTS/STT demos to see if they behavior is the same. Perhaps, then we could rule out that it is anything chatroom specific.

dmedved90 commented 4 years ago

True, the only problem is TTS. It is further interesting that STT is properly recognizing Croatian and is working as expected. I will further investigate and post the solution (if found). Thanks for the help.

hotzenklotz commented 4 years ago

TTS was added by a community member to the project. Perhaps, he/she has more insights on how Chrome's TTS works. cc @diogomqbm

Related PR: https://github.com/scalableminds/chatroom/pull/116

diogomqbm commented 4 years ago

Hi, @dmedved90 I tried to make a demo with "hr-HR" language but it seems to not be working as expected. In my experience, it may seem because the language isn't supported in SpeechSynthesisUtterance. However, it may not be working if your <html> <lang> is different, I really don't know here, I'm guessing. Check this. I couldn't find a proper list of supported languages.

dmedved90 commented 4 years ago

Hi,@diogomqbm, well it seems you are right. Using this tool I confirmed that browsers don't have the same approach to detect speech languages. On the same laptop, I had three different results for Edge, Chrome, and Firefox. I also find detailed explanation on this behavior and recommendation on how to correct this. Are you able to implement the proposed solution in the chatroom?

diogomqbm commented 4 years ago

Of course! I'll be working on this ASAP.

diogomqbm commented 4 years ago

@dmedved90 Apparently "hr-HR" is not supported on SpeechSynthesis yet. I've added the change you've requested on https://github.com/scalableminds/chatroom/pull/125.

hankshz commented 4 years ago

@diogomqbm I also tried to set voiceLang="zh-CN" with a welcome message in Chinese, but all it says is "Chinese letter letter letter". Any idea what might be the problem? I also tried to set lang="zh" in the html container, but it didn't help. Thanks!

hankshz commented 4 years ago

Hmm, I installed the latest Chrome and it seems to work now...I was using the default Firefox in Ubuntu18.