Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tts should be installed, why not tip? #28

Open
purezhang opened this issue Jun 25, 2024 · 18 comments
Open

Tts should be installed, why not tip? #28

purezhang opened this issue Jun 25, 2024 · 18 comments

Comments

@purezhang
Copy link

Screenshot_20240625_231251
Screenshot_20240625_232407

Tts should be installed, why not tip?

@niedev
Copy link
Owner

niedev commented Jun 25, 2024

As discussed here, on some devices the TTS doesn't work (even Google's one), I don't know why but when I have time I will install on my phone some of the custom ROMs that have this issue to investigate (or I will add an integrated TTS to RTranslator), for now, the only thing you can do is clicking on continue and use RTranslator without TTS.

@fishergz
Copy link

My Xiaomi 10 also encountered this error before. After installing Google TTS, it still didn't work. Then, after switching back to the system's built-in TTS, it returned to work ok.

@niedev
Copy link
Owner

niedev commented Jun 26, 2024

My Xiaomi 10 also encountered this error before. After installing Google TTS, it still didn't work. Then, after switching back to the system's built-in TTS, it returned to work ok.

For now the only TTS supported is the Google one (there's actually a check in the code to make sure you're using Google TTS, it doesn't even matter what TTS you select, the Google TTS will be used if you have installed), so probably the TTS wasn't working at the beginning because a restart of RTranslator was needed.

@starlightjy
Copy link
Contributor

starlightjy commented Jun 27, 2024

@niedev
Hello niedev, I have found the TTS initialization error's reason on these devices include my mobile phone Xiaomi13Ultra powered by Android14, and I have fix it and try it on my phone.
The Apps targeting Android 11 or above that use text-to-speech should declare TTS in the queries elements of the project manifest("AndroidManifest.xml"):

<manifest xmlns:android="http:https://schemas.android.com/apk/res/android"  
    xmlns:tools="http:https://schemas.android.com/tools">  
    <queries>  
        <intent>  
            <action android:name="android.intent.action.TTS_SERVICE" />  
        </intent>  
    </queries>  
    <!--other original configs-->
</manifest>  

QQ截图20240627214218

I download the source code and add these code on AndroidManifest.xml, build apk and install on my phone, my phone can use tts normal (Of course, we should install Google TTS "Speech Recognition & Synthesis" on GooglePlay first).
Here is the google's document:
https://developer.android.com/reference/android/speech/tts/TextToSpeech

@niedev
Copy link
Owner

niedev commented Jun 27, 2024

Thank you very much @starlightjy!

The TTS code was 4 years old and I didn't know about this new declaration, also on my phone with Android 14 it worked, but probably the need for this declaration depends on the specific ROM, so it would explain why some had problems and others didn't.

If you want to appear among the contributors of RTranslator, send me a simple pull request with this change, if you don't have the desire/time I can insert it myself and cite you in the new release, let me know.

@starlightjy
Copy link
Contributor

Thank you very much @starlightjy!

The TTS code was 4 years old and I didn't know about this new declaration, also on my phone with Android 14 it worked, but probably the need for this declaration depends on the specific ROM, so it would explain why some had problems and others didn't.

If you want to appear among the contributors of RTranslator, send me a simple pull request with this change, if you don't have the desire/time I can insert it myself and cite you in the new release, let me know.

@niedev I have made a simple pull request. Thanks for your invite!

@niedev
Copy link
Owner

niedev commented Jun 28, 2024

There is a new release that should fix the TTS issues! 😁 Let me know if it works correctly.

@purezhang
Copy link
Author

My Xiaomi 10 also encountered this error before. After installing Google TTS, it still didn't work. Then, after switching back to the system's built-in TTS, it returned to work ok.

how to do this?
my device is zte-2022P(a30u with myos 13)

There is a new release that should fix the TTS issues! 😁 Let me know if it works correctly.

Does it still appear not to be working properly?
Is there anything else I need to do?

微信图片_20240703171530
微信图片_20240703171628
微信图片_20240703171629
微信图片_202407031716291
微信图片_202407031716292

@niedev
Copy link
Owner

niedev commented Jul 3, 2024

@purezhang, if you go in the settings of RTranslator -> Text to speech, the Google TTS engine is the one selected?

@purezhang
Copy link
Author

@purezhang, if you go in the settings of RTranslator -> Text to speech, the Google TTS engine is the one selected?

Screenrecorder-20240703-231753.mp4

@niedev
Copy link
Owner

niedev commented Jul 3, 2024

@purezhang you should click directly on "preferred engine" to select the TTS engine, not in the preferred engine settings icon, nor below (where you only select the TTS language), let me know.

@starlightjy
Copy link
Contributor

@purezhang 可以先看看小米手机的系统TTS设置,TTS引擎是否选择正确了.把引擎列表和语音都切换试试看(切换后注意重启应用).
image

@purezhang
Copy link
Author

@purezhang 可以先看看小米手机的系统TTS设置,TTS引擎是否选择正确了.把引擎列表和语音都切换试试看(切换后注意重启应用). image

非常感谢你的回复,我上面视频里面已经展示了我的中兴文字转语音选项,只有一个选项就是“中文”,可以帮我看看我的设置是否正确,谢谢

@purezhang
Copy link
Author

@purezhang, if you go in the settings of RTranslator -> Text to speech, the Google TTS engine is the one selected?

如我视频中展示,我的语音转文字选项中 只有一个选项“中文”,没有google tts 等其他选项

As I showed in the video, my voice transcription option has only one option: Chinese language, no other options, etc.

@starlightjy
Copy link
Contributor

根据你的视频,下面我发的截图中, 两个红框区域是不一样的点击区域, 你两个红框区域分别点击一下看看是不是有不一样的内容
QQ截图20240707202042

@purezhang
Copy link
Author

@purezhang you should click directly on "preferred engine" to select the TTS engine, not in the preferred engine settings icon, nor below (where you only select the TTS language), let me know.

根据你的视频,下面我发的截图中, 两个红框区域是不一样的点击区域, 你两个红框区域分别点击一下看看是不是有不一样的内容 QQ截图20240707202042

是的是的,按我的理解,小米是可以选择首选引擎的,而中兴是不能选择的

我点了齿轮修改之后只有一个选项就是中文

@niedev
Copy link
Owner

niedev commented Jul 7, 2024

@purezhang

Screenshot_20240707_143506_Chrome

@starlightjy
Copy link
Contributor

@purezhang you should click directly on "preferred engine" to select the TTS engine, not in the preferred engine settings icon, nor below (where you only select the TTS language), let me know.

根据你的视频,下面我发的截图中, 两个红框区域是不一样的点击区域, 你两个红框区域分别点击一下看看是不是有不一样的内容 QQ截图20240707202042

是的是的,按我的理解,小米是可以选择首选引擎的,而中兴是不能选择的

我点了齿轮修改之后只有一个选项就是中文

你的中兴手机如果安装了GoogleTTS后,还是没有TTS引擎可以选择、切换的话,估计是特定手机系统代码对该功能做了很大的修改(包括但不限于删除了英文TTS引擎的支持,屏蔽了第三方应用调用系统TTS引擎等等). 这样的问题没有实体机调试,很抱歉我暂时无法帮助定位具体问题来解决了.
等待后续是否有其他开发者能定位并解决问题.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants