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 · 12 comments
Open

Tts should be installed, why not tip? #28

purezhang opened this issue Jun 25, 2024 · 12 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://schemas.android.com/apk/res/android"  
    xmlns:tools="http://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

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