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

eSpeak/TalkBack issue when language tag is not provided. #905

Open
raminhalavati opened this issue Apr 2, 2021 · 16 comments
Open

eSpeak/TalkBack issue when language tag is not provided. #905

raminhalavati opened this issue Apr 2, 2021 · 16 comments

Comments

@raminhalavati
Copy link

Hi,

If you go through the following steps (on Android):

  • Install eSpeak as TTS and set it's language to Persian.
  • Select eSpeak as the default TTS for Talkback.
  • Go to Chrome and navigate to http://bit.ly/irprogrammers. The page is in Persian (Farsi), but doesn't have a language tag.

You can observe that instead of reading the page in Persian, it reads it as English/Arabic and one letter at a time. I raised the issue to the TalkBack team and they said:
"In case the webpage-content or talkback-language-preference provide locale-span, Talkback is sending the language through locale-span, but it seems that eSpeak is ignoring it." and "locale-span-language would be set by the talkback-language-preference, or no locale-span-language if no talkback-language-preference is set."

Is it something that you can take a look at? Or is there any issue that needs to be fixed on the talkback side and I can follow up?

@shadyar

@valdisvi
Copy link
Member

valdisvi commented Apr 2, 2021

Pronunciation language in Android is set manually by application preferences.

@shadyar
Copy link
Contributor

shadyar commented Apr 2, 2021

Persian characters mainly are intersection with Arabic characters , so that eSpeak is not able to distincts the pronunciation language from a given string.
By default espeak supposes when a given string contains Arabic characters, without any language span, its pronunciation language is Arabic. There is not reliable method to discriminate between Arabic and Persian from the characters.
In this case eSpeak attempts to speech a given string in Persian by its Arabic rules.
I suggest, Talk-Back should not send strings without language span or blank language span. When a web content does not have language tag, Talk-Back should fill language span with the same language chosen as default user TTS language.

@raminhalavati
Copy link
Author

raminhalavati commented Apr 6, 2021

Thank you. I will follow up the issue with Talkback and loop back.

@raminhalavati
Copy link
Author

I talked with the Talkback team and they said text-to-speech-language setting is passed to third-party text-to-speech-engines.
So it seems that the Android eSpeak app has the value, and can pass it to eSpeak engine in this case. What do you think about it? How can it be followed up?

@shadyar
Copy link
Contributor

shadyar commented Apr 8, 2021

I think, this issue should be followed by Android port team of eSpeak. @rhdunn

@rhdunn
Copy link
Member

rhdunn commented Apr 8, 2021

@raminhalavati
Copy link
Author

It seems to be populated in SynthesisRequest. Documentation says the language is an ISO 639-3 letter language code, but this issue is not Farsi specific and can happen for any language for for which espeak heuristics cannot correctly detect the language.

@rhdunn
Copy link
Member

rhdunn commented Apr 10, 2021

The language selection should work if fas is passed as the language code, in that it should use the Farsi (Persian) voice. If the exact values that are being passed to espeak are known then a test case could be added to ensure it is behaving correctly. It could be that Android is using a different language code for Persian, or is passing a combination of language and country codes that is not handled correctly by espeak.

@raminhalavati
Copy link
Author

Thank you, how I can I follow up if the value is passed to eSpeak from TalkBack, or there is something wrong at TalkBack side?

@raminhalavati
Copy link
Author

Gentle reminder @rhdunn

@zahra21
Copy link

zahra21 commented Jun 11, 2021

Persian characters mainly are intersection with Arabic characters , so that eSpeak is not able to distincts the pronunciation language from a given string.
By default espeak supposes when a given string contains Arabic characters, without any language span, its pronunciation language is Arabic. There is not reliable method to discriminate between Arabic and Persian from the characters.
In this case eSpeak attempts to speech a given string in Persian by its Arabic rules.
I suggest, Talk-Back should not send strings without language span or blank language span. When a web content does not have language tag, Talk-Back should fill language span with the same language chosen as default user TTS language.

hi.
today, i realized that espeak ng 2.5.6 is available since may 30.
and version 2.5.7 which supports android 4.3 till the android eleven, is available since last week.
i wish to know is this issue resolved in newer versions of espeak?
i really wish to use android!
but did not use until now!

@raminhalavati
Copy link
Author

raminhalavati commented Jun 14, 2021

Hi,

I did not get any reply from e-speak NG code owners. I am following up with Talkback to see if they can send the default when language span is empty.

@alex19EP
Copy link
Member

Thank you, how I can I follow up if the value is passed to eSpeak from TalkBack, or there is something wrong at TalkBack side?

hello. can you explicitly select needed language in talkback local menu.
and provide your result.

@raminhalavati
Copy link
Author

Hi,
When a language is selected in Talkback as default TTS language, and user navigates to a webpage without a language tag, Talkback sends the default TTS langauge in a manner that eSpeak currently ignores it (details in previous comments).
From the comments on April 8 and 10, I understand that eSpeak can read the default language from SynthesisRequest.

@rhdunn
Copy link
Member

rhdunn commented Jun 14, 2021

What are the values for getLanguage, getCountry, and getVariant and getVoiceName passed to eSpeak from the SynthesisRequest. Without knowing that, I cannot trace what is happening.

On lollipop and later, eSpeak uses the value of getVoiceName if set, otherwise (if the voice name is null or empty, or on android prior to lollipop) it uses the language/country/variant to select the voice.

What is likely happening is that the request is including the voice name (the default selected language) and that is set to English, so it is reading the Arabic/Persian characters one character at a time in English. You will need to set the default language to Farsi/Persian to get the page to read correctly.

@raminhalavati
Copy link
Author

My Android knowledge is not at a level that I would be able to test if the values are available in the API, but the default language is selected in TalkBack UI.

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

6 participants