speech-translator-ext / speech-translator-readme

This repository outlines the procedures and general information for the Speech Translator project.
https://st.kappaflow.dev
47 stars 2 forks source link

Speech recognition works poorly in Chrome with Japanese speech language and doesn't work in Edge on macOs with ARM chips #11

Open rayryeng opened 11 months ago

rayryeng commented 11 months ago

Hello, this extension has been working great for a while but today it stopped working. I've run through all of the setup steps again and the audio is still not being translated properly. There seem to be no errors that are produced. To be sure, I've also set up a Google Script so it uses my personal account for the translations instead of the public API. To be sure, I have checked the logs for the Google Script and there have been zero uses, so I have not exceeded the translation limit.

kappaflow commented 11 months ago

@rayryeng to diagnose the issue I need some more information.

  1. Please let me know what "speech language" and "translate to" language is selected.
  2. Please let me know if the speech recognition (without using the extension) works on this page: https://www.google.com/intl/en/chrome/demos/speech.html
  3. Can you try to run the listening in a popup window, then open inspect window and share the output (when the issue occurs)?
  4. Can you try to install Edge Browser and run the extension there and let me know if it works?

I heard from some people that Google speech recognition servers (not Google Translate) don't work for them. I don't know what's the reason for that. Using a different network suppose to resolve the issue, but usually its easier to just use Edge in this case, so the extension could use Microsoft speech recognition servers.

rayryeng commented 11 months ago

Hello @kappaflow Thanks for the reply! The answers to your questions are:

  1. Source language is Japanese. Translate to language is English
  2. It works when I set the source microphone to my built-in mic on my Macbook. It does not work when I choose the VB-Input (I suppose that's intentional?)
  3. I'm not sure what you mean here, but I decided to go to Inspect --> View --> Console. This is the output I get:
Screenshot 2023-12-31 at 12 31 02 AM

It appears to be trying to listen for the audio, and the audio is going but no text is being displayed. I've also double checked the source input and I've correctly set it to the Multi Output setting that has both VB Cable and my built-in speaker output:

Screenshot 2023-12-31 at 12 33 03 AM

Did I do this step correctly?

  1. I'll try the Edge Browser extension now and I'll get back to you.
rayryeng commented 11 months ago

Hello @kappaflow - I've tried to install the Edge browser, and when I try and configure the plugin, there is no option for choosing Microsoft services. Only the Google services are available.

Is there something extra I need to do to choose the Microsoft services for the translation?

Screenshot 2023-12-31 at 12 55 12 AM
kappaflow commented 11 months ago

It works when I set the source microphone to my built-in mic on my Macbook. It does not work when I choose the VB-Input (I suppose that's intentional?)

If you are capturing audio from the microphone, so you should select your mic instead of VB-Input.

I'm not sure what you mean here, but I decided to go to Inspect --> View --> Console. This is the output I get:

The console output on your screenshot looks correct (doesn't show any errors). Did the recognition work when you did the test? Also, are you sure that the extension is using the microphone input? (you can click "Grant Audio Permission" on the instruction page to set the audio source). You don't even need to use Virtual Cable setup if you are going to capture the audio only from your mic.

I've tried to install the Edge browser, and when I try and configure the plugin, there is no option for choosing Microsoft services. Only the Google services are available.

The recognition service depends on the browser you use and can't be manually selected. The option on the screenshot is "Translation Service", which is different to a speech recognition service.

kappaflow commented 11 months ago

@rayryeng I have an update, I did a test with Japanese language, and I can confirm that for some reason Google (Chrome browser) recognizes it terribly (sometime better sometimes worse). Although, it used to work much better as I remember...

So the solution for now is to use Edge Browser, until Google fixes Japanese language recognition... . If you don't want to use Edge as a web browser, you can use a standalone application setup with Edge: chrome-extension://jodfjmaiakpnmeddgpeflpafebmlhppn/options.html#instruction#use-as-standalone-application

rayryeng commented 11 months ago

Hello @kappaflow So I restarted my computer and now the plugin for Google Chrome now works. However, I have not been able to get it working on Microsoft Edge. Every time I try to get it to authorize listening the audio, it would exit the window where I could confirm the audio choice. On top of this, every time I try and start the app, it immediately closes. For now I will go back and use the Google Chrome app, but is there a way to diagnose why the Edge app isn't working?

kappaflow commented 11 months ago

Hello @rayryeng, based on my test the problem with Japanese recognition was global, so it wasn't just a problem with your computer.

I have experienced an issue where Edge crushed with some versions of Linux, but in MacOs it worked. Can you tell what version of Edge did you try to use? Also, can you try these versions: https://www.microsoft.com/en-us/edge/download/insider?form=MA13FJ You can find Canary, Dev and Beta versions there.

DevTK0 commented 11 months ago

I have the same problem as @rayryeng. On Edge it immediately closes. It's working fine on Chrome.

Microsoft Edge Version 120.0.2210.91 (Official build) (arm64) macOS Sonoma 14.2.1

The console throws these errors no matter which language you pick:

[ST] Starting listening...
chrome-extension://jodfjmaiakpnmeddgpeflpafebmlhppn/assets/popup-618d9cbb.js:1 [ST:error] Speech recognition error: language-not-supported
chrome-extension://jodfjmaiakpnmeddgpeflpafebmlhppn/assets/popup-618d9cbb.js:1 [ST] Ended with error
kappaflow commented 11 months ago

@DevTK0 thank you for letting know! Have you tried other versions of Edge?

Earlier I did a test with macOs Monterey (x64) and Beta (or dev) version of Edge and it worked. But latest versions of MacOs and stable version of Edge gives the error you've mentioned.

DevTK0 commented 10 months ago

I tried the Beta version of Edge and it still doesn't work. I'm guessing that you are using the Speech Recognition API? Doesn't seem like it is supported in Edge yet according to caniuse.

On Microsoft's release notes for both Dev and Stable versions, it says that :

Support for Speech Recognition APIs. Starting with Microsoft Edge version 91, API support for speech recognition commands on Google.com and similar sites will be added. This feature is limited to a randomly selected group of users who have enabled experimentation. These users are giving feedback to the feature team.

kappaflow commented 10 months ago

On Microsoft's release notes for both Dev and Stable versions, it says that :

Support for Speech Recognition APIs. Starting with Microsoft Edge version 91, API support for speech recognition commands on Google.com and similar sites will be added. This feature is limited to a randomly selected group of users who have enabled experimentation. These users are giving feedback to the feature team.

This is very old release note. As I've mentioned I've tested the extension in Edge under different OS. It works without any issues on Windows, on some Linux versions it may crash or not work, and it worked on macOs Monterey (x64) and it seems like it doesn't work on the latest MacOs releases with arm (have no information about x64). By the way, have you tried the dev built of Edge?

You can check the compatibility here: https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API#browser_compatibility

rayryeng commented 10 months ago

Hi @kappaflow - I have a Macbook M2 Max, which explains why the Edge app is crashing. I don't have a choice but to use Google Chrome for now then.

In the interim, I would recommend adding that Mac with ARM architectures are currently not supported at this time for the Edge browser in your release notes.

kappaflow commented 10 months ago

@rayryeng if it doesn't work in Canary, Dev and Beta versions of Edge, then hopefully Microsoft will fix it later... I have reported the issue, but I guess you can do it as well, more people do it, more chances to make it fixed faster...

I don't have Mac on arm myself, so its a bit difficult to test, but the troubleshooting guide has information about possible issues with the extension on Mac.