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

Add Text-To-Speech Functionality #88

Closed
ghost opened this issue Sep 23, 2021 · 62 comments
Closed

Add Text-To-Speech Functionality #88

ghost opened this issue Sep 23, 2021 · 62 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ghost
Copy link

ghost commented Sep 23, 2021

Hi, as of today SimplyTranslate supports Google TTS, (you can see it here: https://simplytranslate.org) and I would love for this to be implemented in this app as well. There is an api endpoint at /api/tts?engine={engine}&lang={lang}&text={text}

@Valdnet Valdnet added the enhancement New feature or request label Sep 23, 2021
@ManeraKai ManeraKai added this to the v1.1.2 milestone Oct 6, 2021
ManeraKai pushed a commit that referenced this issue Oct 6, 2021
@ManeraKai
Copy link
Owner

Added a pause button: d00c5f5

@ManeraKai
Copy link
Owner

For testing it: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1315014419

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 7, 2021

@ManeraKai @metalune1 Why the sample text below cannot be read by the "SimplyTranslate" translator and therefore the mobile application cannot read the translation?

Should be corrected:
No message appears when you enter text for the first time after deleting 1 character and re-entering the character. It appears only after deleting 2 characters and re-entering the character.

Google Translator reads correctly.

@ManeraKai
Copy link
Owner

It has to do with the length of the message. Cut it a little bit and it will work.

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 7, 2021

Steps:

  1. Enter the text to be translated.
  2. Translate with the "Translate" button.
  3. Delete all translation text by keyboard or text editing toolbar.

The "Speaker" icon is not gray (inactive).

obraz

@ManeraKai
Copy link
Owner

ManeraKai commented Oct 7, 2021

The "Speaker" icon is not gray (inactive).

Yeah I've noticed and changed this before 2 minutes.

@ManeraKai
Copy link
Owner

Enabled the stop button all the time even if there is not text too.

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 7, 2021

Enabled the stop button all the time even if there is not text too.

Exactly. It has to do with the fact that the application allows for translation 😉.

It has to do with the length of the message.

Not good. It should translate longer sentences 😬.

If there is a restriction by Google Translator then user should be informed when reading that the sentence is too long or change the "Speaker" icon to gray (inactive) because it looks like the application has a bug.

@ManeraKai
Copy link
Owner

ManeraKai commented Oct 7, 2021

If there is a restriction by Google Translator then user should be informed when reading that the sentence is too long or change the "Speaker" icon to gray (inactive) because it looks like the application has a bug.

It gives an error without explaining anything. We're guessing that it's because of length by testing:
image

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 7, 2021

If this is an unknown error, inform the user of the application when reading it, or:

the sentence is too long or change the "Speaker" icon to gray (inactive) because it looks like the application has a bug.

@ManeraKai
Copy link
Owner

I'll try first to TTS the long text first (Reverse engineering). If it doesn't work, we'll notify the user about it.

@ManeraKai
Copy link
Owner

Nope. I'll notify the user to read it by himself.

@ManeraKai
Copy link
Owner

Added a notification when the user tries to click the disabled tts button. Extracted a string for translation from it too.

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 7, 2021

Change Can't -> Cannot. This version is officially used in applications 😉. It does not shorten.

"audio_limit": "Can't get audio for more than 200 characters.",

"audio_limit": "Cannot get audio for more than 200 characters.",

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 7, 2021

Translation made in PR: #119.

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 8, 2021

I noticed that the instance in the application settings is now set to "Random". As a result, if the application uses the st.alefvanoon.xyz instance, TTS does not work properly due to the lack of implementation on the server.

The user is confused that TTS is working correctly once (if using simplytranslate.org) and once it is not working (if using st.alefvanoon.xyz). The user has no information that if he uses random choice, or from st.alefvanoon.xyz, he cannot use the TTS.

I suggest:

  • Go back to setting the default instance on simplytranslate.org.

If there are no plans to implement TTS in the st.alefvanoon.xyz instance, I suggest:

To set the default instance of st.alefvanoon.xyz:

  • Inform the user when using TTS (tap on the "Speaker" icon) that he is using an instance that does not support TTS and that if he wants to use TTS he can change to another one in the application settings.

To set the default instance to "Random":

  • Inform the user when using TTS (tap on the "Speaker" icon) that he is using a random instance that does not support TTS and that if he wants to use TTS he can change to another one in the application settings.

Currently, it only gets the message "Something went wrong".

And it would be best to implement TTS quickly on the server for st.alefvanoon.xyz.

@ManeraKai
Copy link
Owner

I've contacted alefvanoon about that. Official instances should be up-to-date imo, but having a more detailed error message for any custom instance is good though.

@ManeraKai
Copy link
Owner

ManeraKai commented Oct 8, 2021

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 8, 2021

Cool 👍.

Go back to setting the default instance on simplytranslate.org.

Remember about this change.

@ManeraKai
Copy link
Owner

If there are no plans to implement TTS in the st.alefvanoon.xyz instance, I suggest:

Waiting for his response. The random option only includes official instances.

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 8, 2021

Waiting for his response. The random option only includes official instances.

Ok 😉.

Can you add a new text string for translation?

Is it's correct? Shouldn't there be its?

@ManeraKai
Copy link
Owner

Is it's correct? Shouldn't there be its?

Sorry

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 9, 2021

Steps:

  1. Enter the text to be translated longer than 200 characters.
  2. Translate with the button "Translate."

After translation, the text is shorter than 200 characters and the "Speaker" icon is still inactive (gray). TTS works.

obraz

ManeraKai pushed a commit that referenced this issue Oct 9, 2021
@ManeraKai
Copy link
Owner

Sorry: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1324063014

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 9, 2021

With quick taps (several times) on the "Speaker" icon, a message appears several times about the inability to start TTS.

The error occurs for the translation window and the translated text window.

obraz

@ManeraKai
Copy link
Owner

Yeah because the instance selection is random. I've sent an email to @alefvanoon on Thursday, and a message on Matrix this day. and I'm waiting for his response. We'll try to add a skip logic if he didn't respond in those 2 coming days.

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 9, 2021

But the error is because if you quickly tap the "Speaker" icon several times. In my opinion, it should be blocked from tapping the "Speaker" icon until the message appears.

Normally if TTS is running it is possible to stop speech. In the absence of TTS support by the instances, it is possible to tap several times, which causes the message to appear several times. See the application screen is black, caused by the pop-up of multiple message boxes.

@ManeraKai
Copy link
Owner

ManeraKai commented Oct 9, 2021

Oh sorry, I misunderstood 👍

@ManeraKai
Copy link
Owner

This solution will be temporary until we get tts support info end point from the server-side: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1324175441

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 9, 2021

You did the TTS block very nicely 👍.

The next error is:

Steps:

  1. Enter your text.
  2. Translate the text with the "Translate" button.
  3. Tap on the "Speaker" icon in the window for the text to be translated.
  4. Tap on the "Speaker" icon in the translated text window.

You hear the TTS of one text. Then TTS starts from the second window. The icons do not change back to "Speaker".

obraz

ManeraKai pushed a commit that referenced this issue Oct 9, 2021
@ManeraKai
Copy link
Owner

Fixed it: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1324293345

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 9, 2021

Testing successful 👍.

@ManeraKai
Copy link
Owner

Problem now is if the http request took a long time, you don't have a cancel button.

@alefvanoon
Copy link
Contributor

alefvanoon commented Oct 10, 2021

Yeah because the instance selection is random. I've sent an email to @alefvanoon on Thursday, and a message on Matrix this day. and I'm waiting for his response. We'll try to add a skip logic if he didn't respond in those 2 coming days.

Sorry for being late.

My instance was updated.

@ManeraKai
Copy link
Owner

Great! Thanks!

@ManeraKai
Copy link
Owner

Problem now is if the http request took a long time, you don't have a cancel button.

I think by natural the user will try to click on the loading circle to cancel it. I'm making the loading circle clickable and it's function is to cancel the request.

@ManeraKai
Copy link
Owner

I'm making the loading circle clickable and it's function is to cancel the request.

Added that: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1325424181

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 10, 2021

Now TTS works fine 🥇.

@ManeraKai
Copy link
Owner

So, this issue will be closed and the end-point's tts support page feature will be opened in another issue for milestone 1.1.3.

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 10, 2021

Why not release TTS in app version 1.1.2?

@ManeraKai
Copy link
Owner

It is in 1.1.2. Just the tts support page on server side will be for 1.1.3.
I mean this comment: #88 (comment)

@Valdnet
Copy link
Collaborator

Valdnet commented Oct 10, 2021

Hmmm. As for me, the application works fine with TTS, but the decision remains for the developers 😁.

@ManeraKai
Copy link
Owner

That decision will be for the Simple Web team. If they created that page. We'll support it, and vise versa 👍

@Valdnet Valdnet modified the milestones: v1.1.2, v1.1.3 Oct 10, 2021
@ManeraKai ManeraKai modified the milestones: v1.1.3, v1.1.2 Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants